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.
More on Tracing & Sampling
In production, when do you pick tail-based over head-based trace sampling, and what does it cost you?BeginnerHow do you configure head sampling correctly in OpenTelemetry?BeginnerHow do you set up tail sampling in the OpenTelemetry Collector?IntermediateWhy does tail sampling need a load-balancing tier, and how do you build it?AdvancedHow do you combine head and tail sampling in a high-traffic system?AdvancedHow do you get accurate RED metrics if traces are sampled?Intermediate