Context Propagation: Context, Propagators and W3C Headers: OTCA practice questions
Context propagation is what lets OpenTelemetry connect telemetry produced in different services into one picture. Two ideas are involved. Context is the in-process object that carries execution-scoped values, such as the active span and baggage, across API boundaries within one process.
By Ibrahim Yesilay · Published · Updated
Independent community practice, not affiliated with or endorsed by CNCF or The Linux Foundation.
What Context Propagation: Context, Propagators and W3C Headers covers in OTCA
Context propagation is what lets OpenTelemetry connect telemetry produced in different services into one picture. Two ideas are involved. Context is the in-process object that carries execution-scoped values, such as the active span and baggage, across API boundaries within one process. Propagation is the mechanism that serializes that state into a message going to another process and deserializes it on the other side.
A Context is immutable. Writing a value never changes an existing Context; it returns a new Context that contains the old values plus the new one. Languages with implicit context also offer operations to get the current Context and to attach or detach one, and most users touch context through tracing or baggage APIs rather than directly.
Crossing a process boundary is the job of propagators. The Propagators API currently defines the TextMapPropagator, which injects values into and extracts values from a carrier as string key-value pairs, typically HTTP headers. Inject reads the value from a Context and writes it into a mutable carrier on the outgoing side. Extract reads the carrier on the incoming side and returns a new Context. If a value cannot be parsed, Extract must not throw and must not overwrite an existing valid value. A SpanContext created through extraction reports IsRemote as true, which is how samplers know the parent came from another process. Several propagators can be grouped into a composite propagator that runs them in order.
The default propagator format is W3C Trace Context. Its traceparent header has the form version-traceid-parentid-traceflags, for example 00-a0892f3577b34da6a3ce929d0e0e4736-f03067aa0ba902b7-01. The trace ID is 16 bytes, the span ID 8 bytes, and the trailing flags byte carries the sampled bit, so 01 means sampled. The optional tracestate header carries vendor-specific data. Baggage travels in its own W3C Baggage header and holds application-defined name and value pairs. The Baggage API works even when no SDK is installed, so baggage can still flow through a service that only has a propagator configured.
When an SDK is configured with environment variables, OTEL_PROPAGATORS selects propagators as a comma-separated list and defaults to tracecontext,baggage. Other known values include b3 for the single B3 header, b3multi for the separate X-B3 headers, xray, and none. The jaeger and ottrace values are deprecated in favour of W3C Trace Context. Without any configuration, the bare API uses no-op propagators, so nothing is injected.
Propagation also interacts with sampling. Under the default ParentBased sampler, a span with a sampled remote parent is sampled, and a span with an unsampled remote parent is dropped. Finally, treat incoming context from untrusted sources with care and never put secrets or personal data into baggage, because it is sent to downstream services.
Key points
- Context is immutable and carries values in-process; propagators move it across process boundaries.
- TextMapPropagator injects into and extracts from carriers such as HTTP headers, and Extract must not throw on bad input.
- The W3C traceparent header is version-traceid-parentid-traceflags, where flags 01 means sampled.
- OTEL_PROPAGATORS defaults to tracecontext,baggage; b3 injects the single header and b3multi the multi-header form.
- The Baggage API is fully functional without an installed SDK.
- Extracted SpanContexts are remote, so ParentBased samples or drops children based on the parent's sampled flag.
Three sample questions
21 OTCA questions on Context Propagation: Context, Propagators and W3C Headers, 21 with explanations. How practice works
Question 1
traceparent: 00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01
What does the final field 01 mean?- A.The traceparent format version is 01
- B.The caller's span is the first span of the trace
- C.The tracestate header carries one list member
- D.The sampled flag is set in trace-flags
Correct answer: D
Sources: W3C Recommendation: Trace Context, OpenTelemetry docs: Context propagation
Question 2
- A.00-00000000000000000000000000000000-00f067aa0ba902b7-01
- B.00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-00
- C.00-a0892f3577b34da6a3ce929d0e0e4736-f03067aa0ba902b7-01
- D.00-0af7651916cd43dd8448eb211c80319c-b7ad6b7169203331-01
Correct answer: A
Sources: W3C Recommendation: Trace Context, OpenTelemetry docs: Context propagation
Question 3
- A.Drop the debug flag, because OpenTelemetry has no debug concept in TraceFlags
- B.Keep the debug flag for later requests and also set the sampled trace flag
- C.Reuse the incoming X-B3-SpanId as the span ID of the new server-side span
- D.Mark the context as not sampled until the local sampler confirms the debug flag
Correct answer: B
Sources: OpenTelemetry spec: Propagators API, OpenTelemetry spec: SDK environment variables
Practice this topic
Focus mode keeps every question on Context Propagation: Context, Propagators and W3C Headers until you leave it. 10 free guest answers, then a free account; no credit card.
Or open OTCA practice across all topics.
Sources
The explanation above was checked against these official documents.
- OpenTelemetry docs: Context propagation (checked 2026-10-28)
- OpenTelemetry spec: Context (checked 2026-10-28)
- OpenTelemetry spec: Propagators API (checked 2026-10-28)
- OpenTelemetry spec: Baggage API (checked 2026-10-28)
- OpenTelemetry spec: Tracing API (checked 2026-10-28)
- OpenTelemetry spec: Tracing SDK (checked 2026-10-28)
- OpenTelemetry spec: SDK environment variables (checked 2026-10-28)
Frequently asked questions
Why does my service start new traces even though the caller sends trace headers?
A common cause is a propagator mismatch: if the caller sends only B3 headers but the service uses the default tracecontext,baggage propagators, the incoming context is not understood. Configure a matching propagator such as b3 or b3multi.
Is baggage automatically added to spans?
No. Baggage lives in the Context and travels in its own header; adding baggage values to spans, metrics or logs is a separate step.