← Lessons

quiz vs the machine

Gold1380

System Design

The W3C Trace Context Standard

The vendor neutral header format that lets tracing tools interoperate across a mixed system.

5 min read · core · beat Gold to climb

Why a Standard

Before standardization, each tracing vendor used its own headers. A request crossing from one tool to another lost its context. W3C Trace Context defines a common format so any compliant system can read it.

The traceparent Header

The core is the traceparent header with four fields separated by dashes:

  • version, currently 00.
  • trace id, a 16 byte value shared across the request.
  • parent id, the 8 byte id of the calling span.
  • trace flags, including the sampled bit.

A second header, tracestate, carries vendor specific key value data so individual tools can add their own context without breaking the standard fields.

Crossing Boundaries

Each hop reads the trace id, keeps it, and replaces the parent id with its own span id before forwarding. The trace id never changes, which is what stitches the whole request together even across vendors.

Key idea

W3C Trace Context defines the traceparent and tracestate headers so trace id, parent id, and flags pass between tools from different vendors.

Check yourself

Answer to earn rating on the learn ladder.

1. Which field in traceparent stays constant across the whole request?

2. What is the tracestate header for?

3. What does each hop do to the parent id in traceparent?