{"name":"@opentelemetry/propagator-b3","version":"2.7.0","keywords":["opentelemetry","nodejs","tracing","profiling","monitoring","b3"],"author":{"name":"OpenTelemetry Authors"},"license":"Apache-2.0","_id":"@opentelemetry/propagator-b3@2.7.0","maintainers":[{"name":"dyladan","email":"dyladan@gmail.com"},{"name":"pichlermarc","email":"marc.pichler@dynatrace.com"},{"name":"npmjs-account","email":"npmjs-account@opentelemetry.io"},{"name":"trentm","email":"trentm@gmail.com"}],"homepage":"https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-propagator-b3","bugs":{"url":"https://github.com/open-telemetry/opentelemetry-js/issues"},"dist":{"shasum":"af7c95d1f26f168ee8bdc4fa1041ef968ae08f63","tarball":"http://registry-npm.ywwl.com/@opentelemetry/propagator-b3/download/@opentelemetry/propagator-b3-2.7.0.tgz","fileCount":75,"integrity":"sha512-HNm+tdXY5i8dzAo4YankchNWdZ4Z1Boop7lhbb3wltWT0MwEMo0QADRJwrF83pXEeDT+5Bmq4J8sStFaUywE3g==","signatures":[{"sig":"MEYCIQCN1MQa8ad+ETVHNsQI6d9mSzTmkk1zYkTt3x5hiFJFfAIhAMaK8VbnGkDsMuYtBYuwHDTN16qomJ8k/88h2ely3DhF","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@opentelemetry%2fpropagator-b3@2.7.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":118508,"size":16731,"noattachment":false,"key":"/@opentelemetry/propagator-b3/-/@opentelemetry/propagator-b3-2.7.0.tgz"},"main":"build/src/index.js","types":"build/src/index.d.ts","esnext":"build/esnext/index.js","module":"build/esm/index.js","engines":{"node":"^18.19.0 || >=20.6.0"},"gitHead":"a0476eef3cb973bfcc0c2e41f868dd7b484c2ed8","scripts":{"lint":"eslint . --ext .ts","test":"nyc mocha test/**/*.test.ts","clean":"tsc --build --clean tsconfig.json tsconfig.esm.json tsconfig.esnext.json","watch":"tsc --build --watch tsconfig.json tsconfig.esm.json tsconfig.esnext.json","compile":"tsc --build tsconfig.json tsconfig.esm.json tsconfig.esnext.json","version":"node ../../scripts/version-update.js","lint:fix":"eslint . --ext .ts --fix","prewatch":"npm run precompile","align-api-deps":"node ../../scripts/align-api-deps.js","peer-api-check":"node ../../scripts/peer-api-check.js","prepublishOnly":"npm run compile"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:c64b6339-0482-4b67-bd61-0f82fed6a246"}},"repository":{"url":"git+https://github.com/open-telemetry/opentelemetry-js.git","type":"git"},"_npmVersion":"lerna/9.0.5/node@v24.14.1+x64 (linux)","description":"OpenTelemetry B3 propagator provides context propagation for systems that are using the B3 header format","directories":{},"sideEffects":false,"_nodeVersion":"24.14.1","dependencies":{"@opentelemetry/core":"2.7.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"nyc":"17.1.0","mocha":"11.7.5","ts-loader":"9.5.4","typescript":"5.0.4","@types/node":"18.19.130","@types/mocha":"10.0.10","@opentelemetry/api":">=1.0.0 <1.10.0"},"peerDependencies":{"@opentelemetry/api":">=1.0.0 <1.10.0"},"_npmOperationalInternal":{"tmp":"tmp/propagator-b3_2.7.0_1776425223358_0.27179460185212045","host":"s3://npm-registry-packages-npm-production"},"readme":"# OpenTelemetry Propagator B3\n\n[![NPM Published Version][npm-img]][npm-url]\n[![Apache License][license-image]][license-image]\n\nThe OpenTelemetry b3 propagator package provides multiple propagator\nimplementations for systems using the b3 context format. See the\n[b3 specification][b3-spec] for complete details.\n\n## B3 Formats\n\nSingle-Header Format:\n\n```bash\nb3: {TraceId}-{SpanId}-{SamplingState}-{ParentSpanId}\n```\n\nMulti-Header Format:\n\n```bash\nX-B3-TraceId: {TraceId}\nX-B3-SpanId: {SpanId}\nX-B3-ParentSpanId: {ParentSpanId}\nX-B3-Sampled: {SamplingState}\n```\n\n- {TraceId}\n\n  - Required\n  - Encoded as 32 or 16 lower-hex characters\n  - 16 character traceIds will be converted to 32 characters by left-padding\n    with 0s to conform with the [OpenTelemetry specification][otel-spec-id-format]\n\n- {SpanId}\n\n  - Required\n  - Encoded as 16 lower-hex characters\n\n- {ParentSpanId}\n\n  - Optional\n  - Used to support the Zipkin functionality where the client and server spans\n    that make up an HTTP request share the same id\n  - Not propagated by this library\n\n- {SamplingState} - Single-header\n\n  - Optional\n  - Valid values\n    - 1 - Accept\n    - 0 - Deny\n    - d - Debug\n    - Absent - Defer sampling decision\n\n- {SamplingState} - Multi-header\n\n  - Optional\n  - Valid values\n    - 1 - Accept\n    - 0 - Deny\n\n- {Flags} - Multi-header\n  - Optional\n  - Debug is encoded as `X-B3-Flags`: 1. Absent or any other value can be ignored. Debug implies an accept decision, so don't also send the `X-B3-Sampled` header.\n\n## B3 Propagation\n\nThe default `B3Propagator` implements b3 propagation according to the\n[OpenTelemetry specification][otel-b3-requirements]. It extracts b3 context\nfrom multi and single header encodings and injects context using the\nsingle-header b3 encoding by default. The inject encoding can be changed to\nmulti-header via configuration. See the examples below.\n\n### B3 Single-Header Configuration\n\n```javascript\nconst api = require('@opentelemetry/api');\nconst { B3Propagator } = require('@opentelemetry/propagator-b3');\n\napi.propagation.setGlobalPropagator(new B3Propagator());\n```\n\n### B3 Multi-Header Configuration\n\n```javascript\nconst api = require('@opentelemetry/api');\nconst { B3Propagator, B3InjectEncoding } = require('@opentelemetry/propagator-b3');\n\napi.propagation.setGlobalPropagator(\n  new B3Propagator({ injectEncoding: B3InjectEncoding.MULTI_HEADER })\n);\n```\n\n### B3 Single and Multi-Header Configuration\n\nThe B3Propagator always extracts both the single and multi-header b3 encodings.\nIf you need to inject both encodings this can accomplished using a composite\npropagator.\n\n```javascript\nconst api = require('@opentelemetry/api');\nconst { CompositePropagator } = require('@opentelemetry/core');\nconst { B3Propagator, B3InjectEncoding } = require('@opentelemetry/propagator-b3');\napi.propagation.setGlobalPropagator(\n  new CompositePropagator({\n    propagators: [\n      new B3Propagator(),\n      new B3Propagator({ injectEncoding: B3InjectEncoding.MULTI_HEADER }),\n    ],\n  })\n);\n```\n\n## Useful links\n\n- For more information on OpenTelemetry, visit: <https://opentelemetry.io/>\n- For more about OpenTelemetry JavaScript: <https://github.com/open-telemetry/opentelemetry-js>\n- For help or feedback on this project, join us in [GitHub Discussions][discussions-url]\n\n## License\n\nApache 2.0 - See [LICENSE][license-url] for more information.\n\n[discussions-url]: https://github.com/open-telemetry/opentelemetry-js/discussions\n[license-url]: https://github.com/open-telemetry/opentelemetry-js-contrib/blob/master/LICENSE\n[license-image]: https://img.shields.io/badge/license-Apache_2.0-green.svg?style=flat\n[npm-url]: https://www.npmjs.com/package/@opentelemetry/propagator-b3\n[npm-img]: https://badge.fury.io/js/%40opentelemetry%2Fpropagator-b3.svg\n[b3-spec]: https://github.com/openzipkin/b3-propagation\n[otel-b3-requirements]: https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/context/api-propagators.md#b3-requirements\n[otel-spec-id-format]: https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/trace/api.md#retrieving-the-traceid-and-spanid\n","publish_time":1776425223496,"_cnpm_publish_time":1776425223496,"dist-tags":{"canary":"3.0.0-rc.0","latest":"3.1.0","next":"1.8.0"}}