Skip to content

Latest commit

 

History

History
26 lines (21 loc) · 1.15 KB

File metadata and controls

26 lines (21 loc) · 1.15 KB

OpenTelemetry - OpenTracing Shim

Warning

OpenTracing is deprecated, and this shim is deprecated accordingly. It remains available for legacy compatibility, but users should migrate to the OpenTelemetry API directly. See the OpenTelemetry specification guidance on OpenTracing compatibility.

The OpenTracing shim is a bridge layer from OpenTelemetry to the OpenTracing API. It takes OpenTelemetry Tracer and exposes it as an implementation of an OpenTracing Tracer.

Usage

There are 2 ways to expose an OpenTracing tracer:

  1. From a provided OpenTelemetry instance:
    Tracer tracer = OpenTracingShim.createTracerShim(openTelemetry);
  2. From a specific TracerProvider, text map propagator (TextMapPropagator), and http propagator (TextMapPropagator):
    Tracer tracer = OpenTracingShim.createTracerShim(openTelemetry, textMapPropagator, httpPropagator);

Optionally register the tracer as the OpenTracing GlobalTracer:

GlobalTracer.registerIfAbsent(tracer);