Security News
RubyGems.org Adds New Maintainer Role
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
@opentelemetry/propagator-b3
Advanced tools
OpenTelemetry B3 propagator provides context propagation for systems that are using the B3 header format
The @opentelemetry/propagator-b3 npm package is used for B3 propagation format which is a convention for passing trace context information across service boundaries. It supports both single-header and multi-header encoding. This package is part of the OpenTelemetry project which provides a collection of tools, APIs, and SDKs to instrument, generate, collect, and export telemetry data (metrics, logs, and traces) to help analyze a software's performance and behavior.
B3 Propagation
This feature allows the user to extract and inject B3 propagation headers. The B3Propagator can be set as the global propagator in OpenTelemetry.
const { B3Propagator } = require('@opentelemetry/propagator-b3');
const { propagation } = require('@opentelemetry/api');
// Use the B3Propagator for extracting and injecting
propagation.setGlobalPropagator(new B3Propagator());
B3 Multi-header Propagation
This feature supports the B3 multi-header propagation format, which uses multiple headers to transmit tracing information. It is useful when interacting with systems that expect B3 headers in multiple header format.
const { B3MultiPropagator } = require('@opentelemetry/propagator-b3');
const { propagation } = require('@opentelemetry/api');
// Use the B3MultiPropagator for extracting and injecting with multi-header support
propagation.setGlobalPropagator(new B3MultiPropagator());
This package is a Node.js client for Jaeger, a distributed tracing system. It includes Jaeger Tracer which can report tracing information to a Jaeger agent or collector. Jaeger and B3 are both tracing propagation formats, but Jaeger is specific to the Jaeger tracing system, whereas B3 is a more general format used by systems like Zipkin.
The Zipkin npm package is a library that interfaces with the Zipkin API for distributed tracing. Similar to B3, Zipkin uses B3 propagation headers for tracing across service boundaries. The Zipkin package provides more comprehensive features for interacting with Zipkin, while @opentelemetry/propagator-b3 focuses on the propagation aspect within the OpenTelemetry ecosystem.
LightStep's tracer library for Node.js is designed to monitor the performance of distributed systems. It uses its own propagation format and is part of the LightStep ecosystem, which is a different distributed tracing solution compared to the B3 propagation used by @opentelemetry/propagator-b3.
The OpenTelemetry b3 propagator package provides multiple propagator implementations for systems using the b3 context format. See the b3 specification for complete details.
Single-Header Format:
b3: {TraceId}-{SpanId}-{SamplingState}-{ParentSpanId}
Multi-Header Format:
X-B3-TraceId: {TraceId}
X-B3-SpanId: {SpanId}
X-B3-ParentSpanId: {ParentSpanId}
X-B3-Sampled: {SamplingState}
{TraceId}
{SpanId}
{ParentSpanId}
{SamplingState} - Single-header
{SamplingState} - Multi-header
{Flags} - Multi-header
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.The default B3Propagator
implements b3 propagation according to the
OpenTelemetry specification. It extracts b3 context
from multi and single header encodings and injects context using the
single-header b3 encoding by default. The inject encoding can be changed to
multi-header via configuration. See the examples below.
const api = require('@opentelemetry/api');
const { B3Propagator } = require('@opentelemetry/propagator-b3');
api.propagation.setGlobalPropagator(new B3Propagator());
const api = require('@opentelemetry/api');
const { B3Propagator, B3InjectEncoding } = require('@opentelemetry/propagator-b3');
api.propagation.setGlobalPropagator(
new B3Propagator({ injectEncoding: B3InjectEncoding.MULTI_HEADER })
);
The B3Propagator always extracts both the single and multi-header b3 encodings. If you need to inject both encodings this can accomplished using a composite propagator.
const api = require('@opentelemetry/api');
const { CompositePropagator } = require('@opentelemetry/core');
const { B3Propagator, B3InjectEncoding } = require('@opentelemetry/propagator-b3');
api.propagation.setGlobalPropagator(
new CompositePropagator({
propagators: [
new B3Propagator(),
new B3Propagator({ injectEncoding: B3InjectEncoding.MULTI_HEADER }),
],
})
);
Apache 2.0 - See LICENSE for more information.
0.25.0
opentelemetry-api-metrics
, opentelemetry-context-zone-peer-dep
, opentelemetry-context-zone
, opentelemetry-core
, opentelemetry-exporter-collector-grpc
, opentelemetry-exporter-collector-proto
, opentelemetry-exporter-collector
, opentelemetry-exporter-jaeger
, opentelemetry-exporter-prometheus
, opentelemetry-exporter-zipkin
, opentelemetry-instrumentation-fetch
, opentelemetry-instrumentation-grpc
, opentelemetry-instrumentation-http
, opentelemetry-instrumentation-xml-http-request
, opentelemetry-instrumentation
, opentelemetry-propagator-jaeger
, opentelemetry-sdk-metrics-base
, opentelemetry-sdk-node
, opentelemetry-sdk-trace-base
, opentelemetry-sdk-trace-node
, opentelemetry-sdk-trace-web
, opentelemetry-shim-opentracing
opentelemetry-exporter-collector-grpc
, opentelemetry-exporter-collector-proto
, opentelemetry-exporter-collector
, opentelemetry-exporter-zipkin
opentelemetry-exporter-collector
opentelemetry-instrumentation-grpc
, opentelemetry-instrumentation-http
, opentelemetry-instrumentation-jaeger
, opentelemetry-exporter-zipkin
, opentelemetry-sdk-trace-base
opentelemetry-instrumentation-fetch
opentelemetry-sdk-trace-base
opentelemetry-resources
, opentelemetry-semantic-conventions
opentelemetry-core
, opentelemetry-exporter-collector-grpc
, opentelemetry-exporter-collector-proto
, opentelemetry-instrumentation-http
, opentelemetry-sdk-trace-node
opentelemetry-propagator-b3
, opentelemetry-propagator-jaeger
, opentelemetry-resources
, opentelemetry-sdk-metrics-base
opentelemetry-core
opentelemetry-resource-detector-aws
, opentelemetry-resource-detector-gcp
, opentelemetry-sdk-node
opentelemetry-exporter-collector-grpc
, opentelemetry-exporter-collector-proto
, opentelemetry-exporter-collector
, opentelemetry-exporter-jaeger
, opentelemetry-exporter-zipkin
, opentelemetry-instrumentation-fetch
, opentelemetry-instrumentation-grpc
, opentelemetry-instrumentation-http
, opentelemetry-instrumentation-xml-http-request
, opentelemetry-sdk-node
, opentelemetry-sdk-trace-node
, opentelemetry-sdk-trace-web
, opentelemetry-shim-opentracing
opentelemetry-api-metrics
, opentelemetry-context-zone-peer-dep
FAQs
OpenTelemetry B3 propagator provides context propagation for systems that are using the B3 header format
The npm package @opentelemetry/propagator-b3 receives a total of 2,588,737 weekly downloads. As such, @opentelemetry/propagator-b3 popularity was classified as popular.
We found that @opentelemetry/propagator-b3 demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.
Security News
Research
Socket's threat research team has detected five malicious npm packages targeting Roblox developers, deploying malware to steal credentials and personal data.