npm.io
2.11.0 • Published 2 weeks ago

@opentelemetry/shim-opentracing

Licence
Apache-2.0
Version
2.11.0
Deps
3
Size
51 kB
Vulns
0
Weekly
0
Stars
3.5K

OpenTracing shim

NPM Published Version Apache License

As of April 2026, OpenTracing compatibility requirements in the OpenTelemetry specification were deprecated. This package (@opentelemetry/shim-opentracing) will be removed in the upcoming SDK 3.0 milestone, planned for approximately September 2026. Version 2.x will be maintained for one year, per the OpenTelemetry stability policy.

OpenTracing shim allows existing OpenTracing instrumentation to report to OpenTelemetry

Installation

npm install --save @opentelemetry/shim-opentracing

Usage

Use the TracerShim wherever you initialize your OpenTracing tracers.

const opentracing = require('opentracing');

// Old tracer initialization.
const tracer = myOpenTracingTracer(...);
opentracing.initGlobalTracer(tracer);

// New tracer initialization.
import { TracerShim } from '@opentelemetry/shim-opentracing';

const tracer = myOpenTelemetryTracer(...)
opentracing.initGlobalTracer(new TracerShim(tracer));

Optionally, you can specify propagators to be used for the OpenTracing TextMap and HttpHeaders formats:

var b3Propagator = new B3Propagator();
new TracerShim(tracer, {
  textMapPropagator: b3Propagator,
  httpHeadersPropagator: b3Propagator
})

If propagators are not specified, OpenTelemetry's global propagator will be used.

License

Apache 2.0 - See LICENSE for more information.

Limitation

The OpenTracing shim does not currently include a scope manager. This feature was never implemented in OpenTracing JS therefore the shim does not provide that feature.

Keywords