{"id":49836,"library":"zipkin-instrumentation-axiosjs","title":"zipkin-instrumentation-axiosjs","description":"Library to instrument the axios HTTP client with Zipkin distributed tracing. Version 0.22.0 is the latest stable release, part of the openzipkin/zipkin-js monorepo. It wraps axios to automatically create and propagate trace headers for outgoing requests. Compared to other Zipkin instrumentations, it is specific to axios and requires both zipkin and axios as peer dependencies. Release cadence is tied to the zipkin-js monorepo; updates are infrequent but stable. Supports ESM and CommonJS via the npm package.","status":"active","version":"0.22.0","language":"javascript","source_language":"en","source_url":"https://github.com/openzipkin/zipkin-js","tags":["javascript"],"install":[{"cmd":"npm install zipkin-instrumentation-axiosjs","lang":"bash","label":"npm"},{"cmd":"yarn add zipkin-instrumentation-axiosjs","lang":"bash","label":"yarn"},{"cmd":"pnpm add zipkin-instrumentation-axiosjs","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"core Zipkin tracing library","package":"zipkin","optional":false},{"reason":"HTTP client to instrument","package":"axios","optional":false}],"imports":[{"note":"Default export; named import will not work.","wrong":"import { wrapAxios } from 'zipkin-instrumentation-axiosjs'","symbol":"wrapAxios","correct":"import wrapAxios from 'zipkin-instrumentation-axiosjs'"},{"note":"CommonJS require gives the default export as a single function.","wrong":"const { wrapAxios } = require('zipkin-instrumentation-axiosjs')","symbol":"wrapAxios (CJS)","correct":"const wrapAxios = require('zipkin-instrumentation-axiosjs')"},{"note":"Package includes TypeScript type declarations; default import works.","wrong":"","symbol":"wrapAxios (TypeScript)","correct":"import wrapAxios from 'zipkin-instrumentation-axiosjs'"}],"quickstart":{"code":"const wrapAxios = require('zipkin-instrumentation-axiosjs');\nconst axios = require('axios');\nconst {Tracer, BatchRecorder, ConsoleRecorder} = require('zipkin');\n\nconst recorder = new BatchRecorder({ logger: new ConsoleRecorder() });\nconst tracer = new Tracer({ ctxImpl: new ExplicitContext(), recorder: recorder, localServiceName: 'my-service' });\n\nconst tracedAxios = wrapAxios(axios, { tracer, serviceName: 'my-client' });\n\ntracedAxios.get('http://example.com').then(resp => console.log(resp.status));","lang":"javascript","description":"Shows how to wrap axios with Zipkin tracing using a console recorder. Replace ConsoleRecorder with an actual Zipkin transport for production."},"warnings":[{"fix":"Use a separate axios instance for instrumented vs non-instrumented requests.","message":"wrapAxios modifies the axios instance in place; it does not return a new instance and does not undo the instrumentation.","severity":"gotcha","affected_versions":"*"},{"fix":"Use latest zipkin API if available, or ignore if no other context implementation is provided.","message":"The package uses deprecated import patterns from zipkin (e.g., ExplicitContext).","severity":"deprecated","affected_versions":">=0.19.0"},{"fix":"Ensure both 'zipkin' and 'axios' are installed and a compatible version.","message":"Requires both zipkin and axios as peer dependencies; missing them will cause a runtime error.","severity":"gotcha","affected_versions":"*"},{"fix":"Upgrade Node.js to 10 or later.","message":"Version 0.22.0 removed support for Node.js 6 and 8.","severity":"breaking","affected_versions":">=0.22.0"},{"fix":"Pass an explicit context like ExplicitContext or the CLI context.","message":"The tracer configuration must include a context implementation; otherwise, traces will not be propagated.","severity":"gotcha","affected_versions":"*"}],"env_vars":null,"search_vec":"'0.22.0':17 'automat':32 'axio':9,30,50,56 'axiosj':4 'cadenc':61 'client':11 'commonj':78 'compar':41 'creat':33 'depend':59 'distribut':14 'esm':76 'header':37 'http':10 'infrequ':72 'instrument':3,7,45 'javascript':83 'js':68 'latest':20 'librari':5 'monorepo':27,69 'npm':81 'openzipkin/zipkin-js':26 'outgo':39 'packag':82 'part':23 'peer':58 'propag':35 'releas':22,60 'request':40 'requir':52 'specif':48 'stabl':21,74 'support':75 'tie':63 'trace':15,36 'updat':70 'version':16 'via':79 'wrap':29 'zipkin':2,13,44,54,67 'zipkin-instrumentation-axiosj':1 'zipkin-j':66","created_at":"2026-06-07T17:03:50.849015+00:00","updated_at":"2026-06-07T17:03:50.849015+00:00","problems":[{"fix":"Use 'import wrapAxios from ...' or 'const wrapAxios = require(...)'","cause":"Using named import instead of default import.","error":"TypeError: wrapAxios is not a function"},{"fix":"Run 'npm install zipkin axios' to install required dependencies.","cause":"Missing peer dependency.","error":"Error: Cannot find module 'zipkin' (or 'axios')"},{"fix":"Provide a recorder (e.g., BatchRecorder or ConsoleRecorder) to the Tracer constructor.","cause":"Tracer instance not properly configured with a recorder.","error":"TypeError: Cannot read property 'record' of undefined"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/openzipkin/zipkin-js#readme","github":"https://github.com/openzipkin/zipkin-js","docs":null,"changelog":null,"pypi":null,"npm":"zipkin-instrumentation-axiosjs","openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}