How do you propagate context across asynchronous boundaries like Kafka?

IntermediateProductionTracing & Sampling
Answer

Inject W3C traceparent/tracestate into message headers on produce and extract on consume. OTel instrumentation for Kafka clients does this automatically. For a consumer processing batches, create a span with links to each message's context rather than a single parent, because one batch has many parents. Without propagation, traces end at the queue.

All Monitoring & Observability questions Roadmap: Logging & tracing

More on Tracing & Sampling