← Glossary / 29 of 100

n. / Tracing basics

Span attributes

Definition

Span attributes are key-value pairs attached to a span that describe what happened, such as the model name, token counts, tool name or user plan. They are what you filter, group and chart by once traces are stored.

In more detail

Good attributes are specific and low in variety, like model, environment and release. Avoid putting whole prompts or personal data in attributes that are used for filtering; keep large payloads as span input and output instead. OpenTelemetry defines standard attribute names for generative AI so different tools agree on what they mean.

Example

A model-call span carries model="gpt-5", inputTokens=1840, outputTokens=212 and environment="production". Filtering on environment and grouping by model shows which model drives your cost.

Definitions are the start.

Open a real trace and watch these terms move.