Skip to main content
POST
Get time-bucketed span metrics

Authorizations

x-api-key
string
header
required

Headers

x-selected-account-id
string | null

Query Parameters

from_ts
string<date-time> | null

The starting (oldest) timestamp in ISO format.

to_ts
string<date-time> | null

The ending (most recent) timestamp in ISO format.

Body

application/json
parents_only
boolean

Only fetch spans that are the top-level (ie. have no parent_id)

span_ids
string[]

Filter by span IDs

trace_ids
string[]

Filter by trace IDs. The combined count of trace_ids, span_ids, excluded_span_ids, excluded_trace_ids, and parent_ids may not exceed 10000. A request over that returns 422.

excluded_span_ids
string[]

List of span IDs to exclude from results

excluded_trace_ids
string[]

List of trace IDs to exclude from results

group_id
string

Filter by group ID

parent_ids
string[]

Filter to the direct children of any of these parent span IDs

names
string[]

Filter by trace/span name

statuses
enum<string>[]

Filter on span status

Available options:
SUCCESS,
ERROR,
CANCELED
types
enum<string>[]
Available options:
TEXT_INPUT,
TEXT_OUTPUT,
COMPLETION_INPUT,
COMPLETION,
KB_RETRIEVAL,
KB_INPUT,
RERANKING,
EXTERNAL_ENDPOINT,
PROMPT_ENGINEERING,
DOCUMENT_INPUT,
MAP_REDUCE,
DOCUMENT_SEARCH,
DOCUMENT_PROMPT,
CUSTOM,
CODE_EXECUTION,
DATA_MANIPULATION,
EVALUATION,
FILE_RETRIEVAL,
KB_ADD_CHUNK,
KB_MANAGEMENT,
GUARDRAIL,
OUTPUT_GUARDRAIL,
TRACER,
AGENT_TRACER,
AGENT_WORKFLOW,
STANDALONE
search_texts
string[]

Case-insensitive substring search across span name, input, output, and metadata (no tokenization or stemming). Multiple terms are ANDed, and UUID-shaped terms match trace IDs instead. Substring means mid-word fragments match, while an inflected form such as a plural matches only where it appears literally. A span must match every non-UUID term, and each term may match any of the searched fields. UUID matches are ORed onto the text match. Each term must be at least 2 characters. For exact trace ID lookup, use the trace_ids filter. Accounts still served by the legacy trace store match differently until migrated: terms match as stemmed whole words rather than substrings, only input and output are searched, the 2-character minimum is not enforced, and characters like :, |, or ! inside a term may be interpreted as query operators or cause an error.

extra_metadata
Extra Metadata · object

Filter on custom metadata key-value pairs

application_variant_ids
string[]

Filter by application variant IDs

assessment_types
string[]

Filter to spans that have at least one assessment of these types

acp_types
string[]

Filter by ACP types

agentex_agent_names
string[]

Filter by Agentex agent names

agentex_agent_ids
string[]

Filter by Agentex agent IDs

min_duration_ms
integer

Minimum span duration in milliseconds (inclusive). An in-flight span with no end time has no known duration and is treated as unbounded, so it matches every minimum.

max_duration_ms
integer

Maximum span duration in milliseconds (inclusive). An in-flight span with no end time has no known duration and is treated as unbounded, so it never falls within a maximum and is excluded.

bucket_minutes
integer
default:30

Size of each time bucket in minutes

metrics
enum<string>[]

Metric groups to compute. Omit or pass an empty list to compute all groups.

An independently loadable metric group for the traces chart.

Available options:
count,
errors,
latency

Response

Successful Response

items
SpansMetricsBucket · object[]
required
bucket_minutes
integer
default:30

Effective bucket size in minutes