oracle / oracle/oci-java-sdk

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

Open
#644 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

SDK
Dominant language
Java
Stars
243
Forks
171
Avg merge
30m
Merged PRs (30d)
4

Description

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()); }
}

}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with bmc-common/src/main/java/com/oracle/bmc/http/internal/ClientCall.java, especially callSync and its existing logger usage. Trace how outgoing OCI resource calls reach this class and how logging levels are configured. Done means HTTP URL and method debug messages are available for those calls when the appropriate log level is enabled.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.