What a span records, precisely
A trace is built from spans, and a span is a small, rigorously structured record:
- Identity: a trace id shared by every span in the request, a span id of its own, and its parent's span id. These three fields are the entire tree structure.
- Timing: start time and duration, which is all a flame graph needs.
- Attributes: key-value context following semantic conventions, the HTTP route, the database system, the status code, so tools can interpret spans from any service uniformly.
- Events and status: timestamped annotations, an exception with its stack trace, and whether the operation succeeded.
Instrumentation libraries create most spans automatically at the boundaries that matter: incoming requests, outgoing calls, database queries. Hand-written spans are added where the automatic ones are blind, around a business operation or an expensive computation.
Key idea: a span is cheap to create and expensive to keep. Everything difficult about tracing is downstream of that asymmetry: the instrumentation is a solved problem; deciding what to retain is not.

