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 = OpenTracingShim.createTracerShim();
- From a provided
OpenTelemetry
instance:Tracer tracer = OpenTracingShim.createTracerShim(openTelemetry);
Optionally register the tracer as the OpenTracing GlobalTracer:
GlobalTracer.registerIfAbsent(tracer);