Skip to main content

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.
  • windowingoldest/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.

Request

Responses

Successful Response