How does context propagation work across services in tracing? [Advanced]
Answer
Context propagation passes trace context across service boundaries so spans can be linked into one trace. It usually uses HTTP headers such as W3C traceparent and tracestate, and equivalent metadata for messaging or RPC systems.
Technical explanation
The caller injects trace context into outbound requests; the callee extracts it and creates child spans.
Without propagation, each service creates separate traces and root-cause analysis becomes fragmented.
For asynchronous systems, context should be propagated through message headers while respecting security and privacy rules.
Hands-on example
Hands-on: ensure services use OTel auto-instrumentation or middleware for HTTP/gRPC. Verify outgoing requests contain traceparent. For Kafka, propagate trace context in message headers. In the trace UI, confirm checkout, payment, inventory, and notification spans share the same trace ID.
Check how well your resume matches the role with our free resume checker— match score, ATS check, and the skills you're missing.
More Observability interview questions
- What is distributed tracing, and what is a span and a trace? [Advanced]
- What is cardinality cost, and how does it differ between metrics and logs? [Advanced]
- What is head-based versus tail-based sampling for traces? [Advanced]
- What is the difference between the OpenTelemetry SDK and the Collector? [Advanced]
- How do you build alerts in Wavefront, and what is a smart alert? [Advanced]
- How does Wavefront handle high-cardinality metrics compared to Prometheus? [Advanced]
- What is the Wavefront proxy, and why use it? [Advanced]
- What is Wavefront (Tanzu Observability), and what is it used for? [Advanced]