Distributed tracing
Also called: Tracing, Span, Trace id
Following one request across several services: each step is a span with timing, and all spans share a trace id passed along in request headers.
Definition
The first service creates a trace id and passes it in the traceparent header (W3C Trace Context) to every downstream call and message. Each service records spans (name, start, duration, attributes, parent) and exports them, for example via OpenTelemetry. The resulting tree shows where the time went, and putting the trace id in every log line connects logs to traces.
In practice
A slow checkout trace shows 1.8 s of its 2 s spent in a single call to the payment provider.