Deprecated
Fetch Analytics
Aggregate span metrics into time buckets.
Runs filtering and windowing identical to POST /tracing/spans/query, then bucketizes the matched spans by time and computes one or more metric summaries per bucket. Use this to build charts of latency, cost, token usage, or custom numeric and categorical attributes.
Request body
- filtering — same shape as the query endpoint, scoped to the spans that contribute to the analytics.
- windowing — oldest/newest for the time range and interval for bucket width (in seconds).
- specs — a list of MetricSpec entries describing which attributes to summarize and how. Each spec declares a type (numeric/continuous, numeric/discrete, binary, categorical/single, categorical/multiple, string, json, or * for auto) and a dotted path into the span (for example attributes.ag.metrics.costs.cumulative.total).
Response
Buckets are returned in chronological order. Each bucket carries a metrics dict keyed by spec path. See Tracing — the ag.* namespace for the cumulative/incremental metric layout on each span.
post/tracing/analytics/query
Query parameters
focus'trace' | 'span'
format'agenta' | 'opentelemetry'
intervalinteger nullable
ratenumber nullable
{"stackTrail":"paths:/tracing/analytics/query:post:parameters:6:schema","oasType":"schema","type":"unknown","title":"Filter"}
{"stackTrail":"paths:/tracing/analytics/query:post:parameters:7:schema","oasType":"schema","type":"unknown","title":"Specs"}
Response
Successful Response