Distributed Tracing
Cheat sheet · https://pcornel.dk/topic.php?topic=6101
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 topiccurl -s localhost:9090/-/ready— Prometheus readycurl -s 'localhost:9090/api/v1/query?query=up'— scrape targets up/downpromtool 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
| Boundary | Inspect | Healthy interpretation | Do not infer |
|---|---|---|---|
| Intent | Trace/span model | Intended object/scope is explicit and versioned where relevant | Intent is already effective |
| Owning runtime/control plane | Parent-child relationships / Context propagation | Owner accepts and reports the expected object state | Downstream dependencies are healthy |
| Effective state | Attributes/events | Independent read-back matches the intended state | Every client sees the same result |
| Consumer outcome | Sampling | The original bounded check succeeds in the same time window | Production 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