Pcornel
Observability

Distributed Tracing

Cheat sheet · https://pcornel.dk/topic.php?topic=6101

Back to the Topic

Answer

Distributed tracing follows a request across services as a trace made of spans (operations with timing, attributes and parent/child links), propagated by trace context headers.

Remember

Every hop must propagate context (W3C traceparent), or traces break. Sampling keeps costs down — make sure error traces are kept.

First checks

  • traceparent — first check for this topic
  • curl -s localhost:9090/-/ready — Prometheus ready
  • curl -s 'localhost:9090/api/v1/query?query=up' — scrape targets up/down
  • promtool check config prometheus.yml — config valid

Verify in this order

request → root span → context propagated → child spans → exported → assembled trace

Where it usually breaks

Common failures are broken context propagation, clock skew, spans ended too early/late, excessive or missing attributes, head sampling dropping rare errors and assuming a slow child span proves the downstream service is the root cause.

Distributed Tracing verification boundary matrix

BoundaryInspectHealthy interpretationDo not infer
IntentTrace/span modelIntended object/scope is explicit and versioned where relevantIntent is already effective
Owning runtime/control planeParent-child relationships / Context propagationOwner accepts and reports the expected object stateDownstream dependencies are healthy
Effective stateAttributes/eventsIndependent read-back matches the intended stateEvery client sees the same result
Consumer outcomeSamplingThe original bounded check succeeds in the same time windowProduction correctness outside this scope

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=6101

Confirmation

Confirm action

Continue?