Lexicon

Span

What a span is in distributed tracing: the timed unit of work inside a trace, how span kinds and attributes work, and how to get span granularity right.

Definition

A span is a single timed operation inside a trace: an HTTP request, a database call, a queue publish, or an internal step worth measuring. Each span records a name, start and end time, attributes, a status, and its parent, and together the spans of one request form a tree.

What it means in observability

Spans are the atomic unit of tracing, and they answer the question every latency investigation starts with: where did the time go. A trace tells you a request took two seconds; its spans tell you 1.7 of those seconds sat in one database call. Because spans carry attributes, they are also queryable events in their own right, so you can ask questions like which endpoints produce the slowest database calls without reading a single full trace.

How it works in practice

Application code and auto instrumentation create spans through a tracer, and each span carries a kind that describes its boundary: server, client, producer, consumer, or internal. Attributes attach detail such as the HTTP route or database statement, named per the semantic conventions. Events mark timestamped moments inside a span, and links connect causally related spans that are not parent and child, which is how asynchronous messaging gets modeled. Completed spans export over OTLP, and the backend reassembles them into traces by shared trace ID.

Where it gets hard

Granularity is the recurring judgment call. Too few spans and investigations dead-end in one giant block of unexplained time; too many and traces become unreadable while volume costs climb. Naming needs discipline too: span names should be low cardinality templates like GET /users/:id rather than raw URLs, or grouping and analytics degrade. And async work trips teams up, since modeling a fire-and-forget job as a child span misrepresents the timing that links exist to capture.

Where Tsuga fits

Tsuga supports full span level search alongside whole trace views, with flame graphs for reading where duration accumulates. Span attributes keep their OpenTelemetry names, so queries written against the conventions work unchanged.

Related terms