Skip to content

feat: add OpenTelemetry instrumentation for SDK client calls #248

@cschanhniem

Description

@cschanhniem

The SDK core handles authentication, HTTP requests, and response parsing for all IBM Cloud Java SDKs, making it a natural place to add distributed tracing instrumentation.

Adding OpenTelemetry support (via the opentelemetry-api dependency) would let consumers:

  1. Automatically create spans for every SDK API call, including HTTP method, path, status code, and duration
  2. Propagate trace context from the calling application into IBM Cloud service calls
  3. Correlate SDK client behavior with application-level traces in tools like Jaeger, Datadog, or New Relic

This could be implemented as an opt-in feature — if OpenTelemetry is on the classpath, the BaseService class creates a span around each sendRequest call and populates http.* semantic convention attributes. No breaking changes to the existing API.

Several major cloud SDKs (AWS SDK v2, Azure SDK, Google Cloud Java) already support this pattern. The IBM Cloud SDK Generator ecosystem would benefit from consistent observability without each generated SDK having to reimplement tracing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions