Traces and spans
A trace is the full journey of one request and is identified by a trace ID. It is made of spans, each representing one unit of work: the web server handling the call, a query to the database, a request to a payment provider. Spans are nested and timed, which produces the waterfall chart used to find the slow piece.
How the ID travels
The first service creates the trace ID and passes it along in a header on every outgoing call. Each service attaches its spans to that ID. The same ID can be written into log lines, so one search shows logs from all services for one customer problem.
Tools and standards
OpenTelemetry is the common instrumentation standard; Jaeger, Zipkin, Grafana Tempo, Datadog and Honeycomb store and display traces.
Reality check
A single monolith rarely needs it. Tracing earns its keep once a request crosses several services, queues and third-party APIs.
Questions, answered
The overhead is small, and sampling a fraction of requests reduces it further.
Logs are separate events; a trace connects the events of one request in order with durations.