Research
Security News
Threat Actor Exposes Playbook for Exploiting npm to Build Blockchain-Powered Botnets
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
@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. The inject encoding can be changed to multi-header
via configuration.
Example usage (default):
const api = require('@opentelemetry/api');
const { B3Propagator } = require('@opentelemetry/propagator-b3');
api.propagation.setGlobalPropagator(new B3Propagator());
Example usage (specify inject encoding):
const api = require('@opentelemetry/api');
const { B3Propagator } = require('@opentelemetry/propagator-b3');
api.propagation.setGlobalPropagator(
new B3Propagator({ injectEncoding: B3InjectEncoding.MULTI_HEADER })
);
If a distributed system only needs support for the b3 single-header
encoding it can use the B3SinglePropagator
directly.
Example usage:
const api = require('@opentelemetry/api');
const { B3SinglePropagator } = require('@opentelemetry/propagator-b3');
api.propagation.setGlobalPropagator(new B3SinglePropagator());
If a distributed system only needs support for the b3 multi-header
encoding it can use the B3MultiPropagator
directly.
Example usage:
const api = require('@opentelemetry/api');
const { B3MultiPropagator } = require('@opentelemetry/propagator-b3');
api.propagation.setGlobalPropagator(new B3MultiPropagator());
If a distributed system needs to support both single and multiple header
encodings for inject and extract the B3SinglePropagator
and
B3MultiPropagator
can be used in conjunction with a CompositePropagator
.
Example usage:
const api = require('@opentelemetry/api');
const { CompositePropagator } = require('@opentelemetry/core');
const {
B3SinglePropagator,
B3MultiPropagator,
} = require('@opentelemetry/propagator-b3');
api.propagation.setGlobalPropagator(
new CompositePropagator({
propagators: [new B3SinglePropagator(), new B3MultiPropagator()],
})
);
Apache 2.0 - See LICENSE for more information.
0.18.1
opentelemetry-instrumentation-fetch
, opentelemetry-web
opentelemetry-semantic-conventions
opentelemetry-instrumentation
opentelemetry-instrumentation-grpc
opentelemetry-resource-detector-gcp
opentelemetry-api-metrics
, opentelemetry-context-async-hooks
, 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-grpc-utils
, opentelemetry-instrumentation-fetch
, opentelemetry-instrumentation-grpc
, opentelemetry-instrumentation-http
, opentelemetry-instrumentation-xml-http-request
, opentelemetry-instrumentation
, opentelemetry-metrics
, opentelemetry-node
, opentelemetry-plugin-grpc-js
, opentelemetry-plugin-grpc
, opentelemetry-plugin-http
, opentelemetry-plugin-https
, opentelemetry-propagator-b3
, opentelemetry-resource-detector-aws
, opentelemetry-resource-detector-gcp
, opentelemetry-resources
, opentelemetry-sdk-node
, opentelemetry-semantic-conventions
, opentelemetry-shim-opentracing
, opentelemetry-tracing
, opentelemetry-web
opentelemetry-resources
opentelemetry-core
opentelemetry-api-metrics
, opentelemetry-context-async-hooks
, opentelemetry-context-zone-peer-dep
, opentelemetry-core
, opentelemetry-exporter-collector-grpc
, opentelemetry-exporter-collector-proto
, opentelemetry-exporter-collector
, opentelemetry-exporter-jaeger
, opentelemetry-exporter-prometheus
, opentelemetry-exporter-zipkin
, opentelemetry-grpc-utils
, opentelemetry-instrumentation-fetch
, opentelemetry-instrumentation-grpc
, opentelemetry-instrumentation-http
, opentelemetry-instrumentation-xml-http-request
, opentelemetry-instrumentation
, opentelemetry-metrics
, opentelemetry-node
, opentelemetry-plugin-grpc-js
, opentelemetry-plugin-grpc
, opentelemetry-plugin-http
, opentelemetry-plugin-https
, opentelemetry-propagator-b3
, opentelemetry-resource-detector-aws
, opentelemetry-resource-detector-gcp
, opentelemetry-resources
, opentelemetry-sdk-node
, opentelemetry-shim-opentracing
, opentelemetry-tracing
, opentelemetry-web
opentelemetry-exporter-zipkin
opentelemetry-core
, opentelemetry-exporter-collector
, opentelemetry-instrumentation-fetch
, opentelemetry-metrics
, opentelemetry-propagator-b3
opentelemetry-propagator-jaeger
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,140,774 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.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.