Traces & Spans
Detailed reference for the tracing data model.
Trace
A trace is the top-level container for a single agent execution.
| Field | Type | Description |
|---|---|---|
id | uuid | Unique trace identifier |
name | string | Human-readable name |
status | running | success | error | Current trace status |
input | JSON | Input data passed to the agent |
output | JSON | Final output from the agent |
tags | string[] | Tags for filtering |
session_id | string | Group traces by session |
duration_ms | integer | Auto-calculated on endTrace |
metadata | JSON | Arbitrary metadata |
Span
A span represents a single step within a trace.
| Field | Type | Description |
|---|---|---|
id | uuid | Unique span identifier |
trace_id | uuid | Parent trace |
parent_span_id | uuid | Parent span (for nesting) |
name | string | Human-readable name |
type | llm | tool | retrieval | agent | chain | span | Span type for color-coding |
model | string | Model name (for LLM spans) |
provider | string | Provider name (openai, anthropic, etc.) |
prompt_tokens | integer | Input tokens used |
completion_tokens | integer | Output tokens used |
total_tokens | integer | Total tokens |
cost_usd | number | Cost in USD |
duration_ms | integer | Auto-calculated on endSpan |
error_message | string | Error details if status is error |
Span Types
| Type | Color | When to use |
|---|---|---|
llm | Blue | LLM API calls (OpenAI, Anthropic, etc.) |
tool | Purple | Tool/function calls (database, API, etc.) |
retrieval | Orange | RAG retrieval, vector search, knowledge base |
agent | Green | Sub-agent execution |
chain | Pink | Chain/pipeline steps |
span | Gray | Generic step (default) |
Nesting Spans
Pass parent_span_id when starting a span to create nested hierarchies:
⚡ The tree view in the dashboard automatically visualizes parent-child relationships between spans.