Interview Prep/Monitoring & Observability/Tracing and OpenTelemetry

How do you trace a request that goes through Kafka from a producer to three consumers?

IntermediateScenarioTracing and OpenTelemetry
Answer

Situation read → Async messaging breaks the simple parent/child chain.

What I'd do →

  1. Use instrumented Kafka clients (OTel Java agent, opentelemetry-instrumentation-kafka-python, confluent-kafka instrumentations) so the producer injects traceparent into message headers.
  2. Consumers extract context and create a span with a link to the producer span (or a child, depending on semantics).
  3. Use messaging semantic conventions (messaging.system, messaging.destination.name).
  4. Track consumer lag as a metric alongside traces.

Why → Links represent fan-out and batch processing better than strict parent/child.

Interview tip → Mention span links for batch consumers that process messages from many traces at once.

All Monitoring & Observability questions Roadmap: Logging & tracing

More on Tracing and OpenTelemetry