Class AwsSdkTelemetry

java.lang.Object
io.opentelemetry.instrumentation.awssdk.v1_11.AwsSdkTelemetry

public class AwsSdkTelemetry extends Object
Entrypoint for instrumenting AWS SDK v1 clients.

AWS SDK v1 is quite old and has some known bugs that are not fixed due to possible backwards compatibility issues. Notably, if a RequestHandler2 throws an exception in a callback, this exception will leak up the chain and prevent other handlers from being executed. You must ensure you do not register any problematic RequestHandler2s on your clients or you will witness broken traces.

  • Method Details

    • getOpenTelemetryContext

      public static io.opentelemetry.context.Context getOpenTelemetryContext(com.amazonaws.Request<?> request)
      Returns the OpenTelemetry Context stored in the Request, or null if there is no Context. This is generally not needed unless you are implementing your own instrumentation that delegates to this one.
    • create

      public static AwsSdkTelemetry create(io.opentelemetry.api.OpenTelemetry openTelemetry)
      Returns a new AwsSdkTelemetry configured with the given OpenTelemetry.
    • builder

      public static AwsSdkTelemetryBuilder builder(io.opentelemetry.api.OpenTelemetry openTelemetry)
      Returns a new AwsSdkTelemetryBuilder configured with the given OpenTelemetry.
    • newRequestHandler

      public com.amazonaws.handlers.RequestHandler2 newRequestHandler()
      Returns a RequestHandler2 for registration to AWS SDK client builders using withRequestHandlers.