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.
There are 2 ways to expose an OpenTracing tracer:
- From the global OpenTelemetry configuration:
Tracer tracer = TraceShim.createTracerShim();
- From the provided
TracerProvider
andCorrelationContextManager
:Tracer tracer = TraceShim.createTracerShim(tracerProvider, contextManager);
Optionally register the tracer as the OpenTracing GlobalTracer:
GlobalTracer.registerIfAbsent(tracer);