X-B3-TraceId
The HTTP X-B3-TraceId request header is an unofficial HTTP header carrying the trace identifier in the Zipkin B3 propagation format for distributed tracing.
Note
The "X-" naming convention for HTTP headers, "X" referring to "experimental", has been deprecated and needs to be transitioned to the formal naming convention for HTTP headers.
Note
The W3C Traceparent header is the standardized replacement for proprietary trace context headers including B3. New integrations are encouraged to adopt the W3C Trace Context format.
Usage
The X-B3-TraceId header originates from the
Zipkin distributed tracing ecosystem. Services
propagate this header alongside companion B3 headers
(X-B3-SpanId, X-B3-ParentSpanId, X-B3-Sampled,
and X-B3-Flags) to correlate requests across
service boundaries. The trace ID remains constant as
a request flows through multiple services, linking
all recorded spans into a single trace.
The B3 propagation format was introduced by the Zipkin project and adopted by tracing libraries such as Brave (Java), Spring Cloud Sleuth, and Istio in legacy header mode. Envoy proxy supports B3 headers alongside the W3C format. Many service meshes and API gateways still generate B3 headers for backward compatibility with existing tracing infrastructure.
The trace ID is either 16 or 32 hexadecimal characters. The 16-character (64-bit) format is the original Zipkin format. The 32-character (128-bit) format aligns with the W3C Traceparent trace ID length and was added to support interoperability between B3 and W3C Trace Context. Systems receiving a 16-character trace ID and forwarding to a W3C-compatible service typically left-pad the value with zeros to produce a 32-character ID.
Values
64-bit trace ID
A 64-bit trace ID is a 16-character lowercase
hexadecimal string. This is the original format used
by Zipkin and remains common in deployments running
older tracing libraries.
128-bit trace ID
A 128-bit trace ID is a 32-character lowercase
hexadecimal string. This format matches the trace ID
length in W3C Trace Context and is the recommended
format for new deployments. The upper 64 bits often
encode a timestamp or are randomly generated.
Example
A service instrumented with Zipkin sends the B3 header set. The 32-character (128-bit) trace ID identifies the trace, and the span ID identifies the current operation within the trace.
X-B3-TraceId: 80f198ee56343ba864fe8b2a57d3eff7
X-B3-SpanId: e457b5a2e4d86bd1
X-B3-ParentSpanId: 05e3ac9a4f6e3b90
X-B3-Sampled: 1
A response from a service using the shorter 64-bit trace ID format. This 16-character hex string is common in older Zipkin deployments.
X-B3-TraceId: 7c6cf5bdd6c2846c
A response from a service mesh or API gateway includes the full 128-bit trace ID. The 32-character format enables direct mapping to the trace ID field in Traceparent.
X-B3-TraceId: cf34637d6ddb269916fec5c33ea0dbc9
Takeaway
The X-B3-TraceId header carries the trace identifier in Zipkin's B3 propagation format, linking spans across distributed services. The W3C Traceparent header is the standardized replacement, and modern tracing systems support both formats during migration.