Course contentsShow
← Cloud and Infrastructure
Lesson 2070 of 2,98944. Observability - TracingFree lesson

Context Propagation Standards

Understanding W3C Trace Context and B3 propagation formats for interoperability.

Context Propagation Standards

What you'll learn: How W3C Trace Context and B3 propagation formats ensure tracing works seamlessly across different services and tools.

When a request travels through multiple services in a distributed system, each service needs to understand which trace it belongs to. Without a common standard, different tracing tools couldn't understand each other's trace IDs—like trying to pass a relay baton between runners who speak different languages.

Why Standards Matter

Imagine Service A uses Jaeger, Service B uses Zipkin, and Service C uses AWS X-Ray. Without a standard way to propagate trace context (the trace ID, span ID, and sampling decisions), each tool would lose track of the request as it crosses boundaries. Standards solve this interoperability problem.

W3C Trace Context

The W3C Trace Context standard defines HTTP headers that carry trace information:

  • traceparent: Contains trace ID, parent span ID, and trace flags
  • tracestate: Vendor-specific trace data (optional)

Format: traceparent: 00-<trace-id>-<parent-id>-<flags>

This is the modern, vendor-neutral standard gaining wide adoption. Think of it as the universal passport for traces.

B3 Propagation

B3 originated with Zipkin and uses multiple headers:

  • X-B3-TraceId: The trace identifier
  • X-B3-SpanId: The current span identifier
  • X-B3-ParentSpanId: The parent span identifier
  • X-B3-Sampled: Sampling decision (0 or 1)

B3 also has a single-header variant: b3: <trace-id>-<span-id>-<sampled>-<parent-span-id>

It's widely supported but less standardized than W3C.

Choosing Your Standard

Many modern systems support both. W3C Trace Context is recommended for new implementations due to its official specification and growing ecosystem support. B3 remains important for Zipkin-based systems and backward compatibility.

Key Takeaway: W3C Trace Context and B3 are the two main standards that let different tracing systems understand each other's context, enabling true end-to-end distributed tracing across heterogeneous environments.