context propagation
What is context propagation?
context propagation: Passing trace identifiers (trace_id, span_id) across service boundaries — usually in HTTP headers — so spans link into one trace. Context propagation passes tracing identifiers from one service to the next, so all the work done for one user request can be linked together. The IDs travel in headers, such as the standard traceparent header.
Frequently asked questions about context propagation
How is context propagation used in practice?
Without it, each service records its own isolated piece. You can see that the API was slow, but not that the time was spent waiting on the payment service, which was waiting on the database.
What should you keep in mind with context propagation?
OpenTelemetry handles most of this automatically for HTTP calls in common frameworks. The gaps are usually message queues and background jobs, where the context has to be stored in the job and restored when it runs. Also add the trace ID to your log lines. Then you can jump from an error in the logs to the full trace of the request that caused it.
What does an example of context propagation look like?
traceparent: 00-ab12...-cd34...-01 At a glance
| Category | Observability |
|---|---|
| Explained by | Reinier de la Parra |
| Updated |