Deploy Grafana Tempo to collect and query distributed traces, configure the OTel Collector to export traces via OTLP, learn to read span waterfalls, apply sampling strategies, and troubleshoot slow requests using trace data.
Understand the core concepts of distributed tracing β traces, spans, and context propagation β and why they matter when debugging microservices.
cat <<'EOF'
=== DISTRIBUTED TRACING CONCEPTS ===
A TRACE is the full journey of a single request across services.
A SPAN is one unit of work within that trace (one function, one HTTP call).
=== ANATOMY OF A TRACE ===
User clicks "Place Order"
β
ββ SPAN: api-gateway /checkout [200ms total]
β ββ SPAN: order-api.createOrder [150ms]
β β ββ SPAN: postgres INSERT [ 20ms]
β β ββ SPAN: payment-api.charge [100ms] β slow!
β β ββ SPAN: stripe-sdk.request [ 95ms]
β ββ SPAN: notification.sendEmail [ 30ms]
β
Trace ID: 4bf92f3577b34da6a3ce929d0e0e4736
=== CONTEXT PROPAGATION ===
How does Service B know it is part of the same trace as Service A?
Service A ββHTTPββ> Service B ββgRPCββ> Service C
β β β
Injects Extracts Extracts
traceparent traceparent traceparent
header header header
W3C Trace Context header:
traceparent: 00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01
version-trace_id-parent_span_id-trace_flags
The OTel SDK handles context propagation automatically.
EOFDistributed tracing solves the fundamental problem of microservices debugging: when a request crosses 5 or 10 services, how do you know which service is slow? A trace gives you a complete timeline. Each service creates spans (units of work), and the OTel SDK propagates a unique trace_id via HTTP headers (W3C Trace Context) so all spans from the same request can be assembled into a single trace. Context propagation happens automatically when you instrument your services with OpenTelemetry.
You see a visual representation of a trace as a tree of spans, the W3C Trace Context header format, and how context propagation links spans across services.