Axios interceptor that wraps HTTP requests with OpenTracing spans for distributed tracing. Version 0.1.3 requires peer dependencies axios ^0.18.0 and opentracing ^0.14.0 (both outdated). Ships TypeScript definitions. Allows either passing an existing span or creating a child span with a given name. Supports any OpenTracing-compatible tracer (Jaeger, Elastic APM, Lightstep). Provides a function that applies request/response interceptors to an axios instance. Low maintenance; last release 4 years ago.
npm install axios-opentracingNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Create an axios instance, apply tracing interceptors with a root span, and make a request.
Pin axios to 0.18.x and opentracing to 0.14.x, or use a different tracing library.
Ensure rootSpan.finish() is called after all requests complete, or use a wrapper that does so.
Initialize global tracer via opentracing.initGlobalTracer() before calling createAxiosTracing().
Provide options object with either 'span' or 'spanName' property.
Use import createAxiosTracing from 'axios-opentracing' (default import).
Run npm install axios-opentracing axios opentracing.