Build a Distributed Tracer

spans and context propagation

Challenge 4 of Platform EngineeringIntermediate~50 min

Follow a single request as it fans out across dozens of services. A trace is a tree of timed spans, one per operation, linked by parent/child ids and sharing a trace id. Build the span with its duration, a tracer that propagates context to child spans, the reassembly of a flat span list into its trace tree, and the analysis that finds total latency and the slowest operation. The model behind Jaeger, Zipkin, and OpenTelemetry.

4 steps

  1. 1The Span
  2. 2The Tracer and Context Propagation
  3. 3Assembling the Trace Tree
  4. 4Analyzing the Trace
Start step 1