Skip to content

Spans API

GET /api/v1/project/{project_id}/otel/spans

Query spans with pagination and filters.

ParameterTypeDescription
pagenumberPage number (default: 1)
limitnumberItems per page (default: 100)
order_bystringSort field (e.g., timestamp_start:desc)
trace_idstringFilter by trace ID
session_idstringFilter by session ID
user_idstringFilter by user ID
environmentstring or arrayFilter by environment
span_categorystringFilter by span category
observation_typestringFilter by observation type
frameworkstringFilter by framework
gen_ai_request_modelstringFilter by model
status_codestringFilter by status code
from_timestampstringFilter from timestamp (ISO 8601)
to_timestampstringFilter to timestamp (ISO 8601)
filtersJSONAdvanced filters (see below)
include_raw_spanbooleanInclude raw OTLP span JSON
is_observationbooleanOnly spans with observation fields
{
"data": [
{
"trace_id": "abc123def456",
"span_id": "span-001",
"span_name": "agent.invoke",
"span_category": "agent",
"framework": "strands",
"timestamp_start": "2025-01-26T10:12:34Z",
"duration_ms": 420,
"gen_ai_system": "bedrock",
"model": "anthropic.claude-sonnet-4-5-20250929-v1:0",
"input_tokens": 150,
"output_tokens": 200
}
],
"meta": {
"page": 1,
"limit": 100,
"total_items": 240,
"total_pages": 3
}
}
Terminal window
# Spans for a trace
curl "http://localhost:5388/api/v1/project/default/otel/spans?trace_id=abc123"
# Filter by model
curl "http://localhost:5388/api/v1/project/default/otel/spans?gen_ai_request_model=anthropic.claude-sonnet-4-5-20250929-v1:0"
# Filter LLM spans only
curl "http://localhost:5388/api/v1/project/default/otel/spans?span_category=llm"
GET /api/v1/project/{project_id}/otel/traces/{trace_id}/spans
GET /api/v1/project/{project_id}/otel/traces/{trace_id}/spans/{span_id}

Optional query params:

  • include_raw_span=true to include the raw OTLP span JSON
GET /api/v1/project/{project_id}/otel/traces/{trace_id}/spans/{span_id}/messages

Get normalized messages (SideML format) for a span.

CategoryDescription
llmLanguage model calls
toolTool/function executions
agentAgent orchestration
chainChain/workflow steps
dbDatabase operations
httpHTTP requests
otherUncategorized

Pass a JSON array in the filters query param:

[{"key": "status_code", "op": "eq", "value": "ERROR"}]