Class OkHttpTelemetry

java.lang.Object
io.opentelemetry.instrumentation.okhttp.v3_0.OkHttpTelemetry

public final class OkHttpTelemetry extends Object
Entrypoint for instrumenting OkHttp clients.
  • Method Details

    • create

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

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

      public okhttp3.Call.Factory newCallFactory(okhttp3.OkHttpClient baseClient)
      Construct a new OpenTelemetry tracing-enabled Call.Factory using the provided OkHttpClient instance.

      Using this method will result in proper propagation and span parenting, for both synchronous and asynchronous usages.

      Parameters:
      baseClient - An instance of OkHttpClient configured as desired.
      Returns:
      a Call.Factory for creating new Call instances.