Span Structure

Reference for the LLM span Revefi stores from each incoming OpenTelemetry span.

Overview

Every LLM call is captured as an OpenTelemetry span. Revefi ingests the raw OTLP span and extracts the GenAI-specific fields into a structured record that powers dashboards and queries.

Revefi parses spans that follow the OpenTelemetry GenAI semantic conventions plus the OpenLLMetry traceloop.* attributes. Any standard instrumentation that emits these (including the Revefi LLM SDK) works out of the box. For the attributes to set when instrumenting manually, see Direct Trace Ingestion.

Stored span

Each span Revefi stores has the following shape:

LLMTelemetrySpan
├─ span_id                 unique span identifier
├─ trace_id                groups spans belonging to one request/trace
├─ parent_span_id          parent span (for nested/agent spans)
├─ name                    span name (e.g. "openai.chat")
├─ kind                    INTERNAL | SERVER | CLIENT | PRODUCER | CONSUMER
├─ start_time_unix_nano    start timestamp (ns since epoch)
├─ end_time_unix_nano      end timestamp (ns since epoch) → latency
├─ status                  code: UNSET | OK | ERROR, optional message
├─ resource                service context
│   ├─ service_name        the app/agent name (service.name)
│   └─ attributes          full resource attributes
├─ extracted_data          structured LLM fields (model, token usage, prompts, completions, tool calls, custom tags, cost)
└─ created_at              ingestion time

Cost, latency, and errors

  • Latency is derived from end_time_unix_nano − start_time_unix_nano.
  • Errors are counted from span status.code = ERROR. Always set the span status on failures so error rate is accurate.
  • Cost uses total_cost_usd_precalculated when the source supplies it; otherwise Revefi derives cost from token counts and the model's pricing.

Did this page help you?