Provide debug options in Java SDK Client to monitor the outgoing external calls for OCI resources

オープン
#644 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
45/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
java
領域
api

調査の方向性

bmc-common/src/main/java/com/oracle/bmc/http/internal/ClientCall.java から始め、特に callSync と既存の logger の使用箇所を確認してください。送信される OCI リソース呼び出しがどのようにこのクラスへ到達するのか、またログレベルがどのように設定されるのかを追跡してください。適切なログレベルが有効な場合に、これらの呼び出しで HTTP URL とメソッドのデバッグメッセージを利用できれば完了です。

索引モデルが issue の本文から書いたものです。

説明

SDK

We need the ability to monitor the outgoing external calls for OCI resources such as OCI streams, Object storage, and secrets etc. I'm creating this issue as an enhancement request to add debug messages containing HTTP URL and method for the external calls. These debug messages can be enabled by changing the log level.

As an experiment, I modified the com.oracle.bmc.http.internal.ClientCall class in "bmc-common" module, and added a debug/print message in the callSync method to print the URI and method of the httpRequest. This was helpful to see the external calls. Following is the file and the "callSync"call method that I modified. Thanks.

File modified - https://bitbucket.oci.oraclecorp.com/projects/SDK/repos/java-sdk/browse/bmc-common/src/main/java/com/oracle/bmc/http/internal/ClientCall.java

Modified "callSync" method -

public RESP callSync() {

    waiterScheduler = WaiterScheduler.SYNC;

    SyncFutureWaiter futureWaiter = new SyncFutureWaiter();

    offloadExecutor = futureWaiter;

    httpRequest = httpRequest.offloadExecutor(offloadExecutor);


    logger.debug("DEBUG>> httpRequest is " + httpRequest);



    try {

        if (httpRequest != null && httpRequest.uri() != null)

{ logger.debug("DEBUG>> URL is " + httpRequest.uri().toString()); }

        if (httpRequest != null && httpRequest.method() != null)

{ logger.debug("DEBUG>> Request method is " + httpRequest.method().toString()); }
return futureWaiter.listenForResult(callAsync0(null));

    } catch (BmcException e)

{ throw e; }
catch (Throwable e)

{ throw BmcException.createClientSide("Unknown error", e, null, buildServiceDetails()); }
}

}

主要言語
Java
スター
243
フォーク
171
平均マージ
5分
マージ済み PR(30日)
4

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

oracle/oci-java-sdk のほかの issue

oracle/oci-java-sdk の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。