Fetch Analytics
POST/tracing/analytics/query
deprecated
This endpoint has been deprecated and may be replaced or removed in future versions of the API.
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/newestfor the time range (matched against each span'sstart_time),intervalfor bucket width (in minutes), and an optionalrateto sample a share of the traces. Figures describe the sample only. Whenintervalis set, buckets with no spans are returned empty.formatting.focus—trace(default) summarizes root spans only, which carry the cumulative metrics of their trace.spansummarizes every span.specs— a list ofMetricSpecentries describing which attributes to summarize and how. Each spec declares atype(numeric/continuous,numeric/discrete,binary,categorical/single,categorical/multiple,string,json, or*for auto) and a dottedpathinto the span (for exampleattributes.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.
Request
Responses
- 200
- 422
Successful Response
Validation Error