@opentelemetry/shim-opentracing
TypeScript icon, indicating that this package has built-in type declarations

1.24.0 • Public • Published

OpenTracing shim

NPM Published Version Apache License

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.

See examples/opentracing-shim for a short example.

License

Apache 2.0 - See LICENSE for more information.

Useful links

Dependencies (3)

Dev Dependencies (13)

Package Sidebar

Install

npm i @opentelemetry/shim-opentracing

Weekly Downloads

14,579

Version

1.24.0

License

Apache-2.0

Unpacked Size

55.4 kB

Total Files

12

Last publish

Collaborators

  • pichlermarc
  • bogdandrutu
  • dyladan