Traceparent

The HTTP Traceparent request header carries distributed tracing context in a standardized format defined by the W3C Trace Context specification.

Usage

Distributed systems pass the Traceparent header between services to maintain a consistent trace identity across the entire request path. Each service in the chain reads the incoming trace and span identifiers, records its own span, and propagates an updated header to the next service. This creates a tree of spans linked by a single trace ID, giving operators full visibility into latency and errors at every hop.

The header follows a fixed format with four fields separated by hyphens: version, trace ID, parent ID, and trace flags. The version field allows the format to change over time. The trace ID stays constant across all services handling the same request. The parent ID (also called span ID) changes at each hop to represent the current operation. The trace flags field controls sampling behavior.

The W3C Trace Context specification defines Traceparent as the standard replacement for proprietary trace headers like X-Cloud-Trace-Context, X-Amzn-Trace-Id, and X-B3-TraceId. Major cloud platforms, observability tools, and service meshes support this header natively. The companion Tracestate header carries vendor-specific trace data alongside Traceparent.

Values

version

The version field is a 2-character hexadecimal value identifying the trace context format version. The current version is 00. Receivers encountering an unknown version treat the rest of the header as opaque and forward the value unchanged.

trace-id

The trace-id is a 32-character hexadecimal string (16 bytes) uniquely identifying the entire distributed trace. All services processing the same request share the same trace ID. A value of all zeros (00000000000000000000000000000000) is invalid and indicates a missing trace.

parent-id

The parent-id is a 16-character hexadecimal string (8 bytes) identifying the current span within the trace. Each service generates a new parent ID before propagating the header downstream. A value of all zeros (0000000000000000) is invalid.

trace-flags

The trace-flags field is a 2-character hexadecimal value controlling trace behavior. The least significant bit is the sampled flag. A value of 01 means the trace is sampled and the caller expects trace data to be recorded. A value of 00 means the trace is not sampled, though downstream services are free to override this decision.

Example

A request passes through a service with sampling disabled. The version 00 indicates the current format. The 32-character trace ID identifies the full trace, the 16-character parent ID identifies the immediate span, and 00 in the flags position means the trace is not being sampled.

Traceparent: 00-4d502c03384abc99124806be91afdfe7-a7e7f36238457189-00

A sampled trace from an instrumented service sets the flags field to 01, indicating trace data is actively being collected and stored by the tracing backend.

Traceparent: 00-c8729428fcd444387165c152734897f7-ee9c3cff8b9382ae-01

A typical distributed tracing setup sends both Traceparent and Tracestate together. The Traceparent header carries the standard trace context, while Tracestate carries vendor-specific metadata.

Traceparent: 00-f5793ff3bab328e635d9484d4053492d-17737305481aefd8-01
Tracestate: dd=s:1;t.dm:-4,congo=t61rcWkgMzE

Takeaway

The Traceparent header is the W3C standard for propagating distributed trace context across service boundaries, replacing proprietary trace headers with a single interoperable format.

See also

Last updated: March 6, 2026