---
title: "Aggregate traces"
method: POST
path: "/v1/observability/traces/aggregate"
tags: ["beta.observability.traces"]
---

# Aggregate traces

`POST /v1/observability/traces/aggregate`

Aggregate traces

## Query parameters

- `from` string, date-time, nullable
- `to` string, date-time, nullable

## Request body

- AggregationRequest
  - `metric` MetricDefinition, required
    - `measure` string, required
    - `aggregation` 'count' | 'count_distinct' | 'sum' | 'avg' | 'min' | 'max' | 'p50' | 'p90' | 'p95' | 'p99', required
  - `dimensions` string[]
  - `time_dimension` TimeDimension
    - `granularity` 'auto' | 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month'
  - `search_expression` string, nullable
  - `order_by` OrderByClause[], nullable
    - `field` string, required
    - `direction` 'asc' | 'desc'
  - `limit` integer

## Response `200`

Successful Response

- Aggregation
  - `data` AggregationRow[], required
    - `time_bucket` string, date-time, nullable
    - `dimensions` object
    - `metric_name` string, required
    - `metric_value` union
      - number
      - integer
  - `meta` AggregationMeta, required
    - `from_timestamp` string, date-time, required
    - `to_timestamp` string, date-time, required
    - `granularity_seconds` integer, nullable

## Other responses

- `400` — Bad Request - Invalid request parameters or data
- `404` — Not Found - Resource does not exist
- `408` — Request Timeout - Operation timed out
- `409` — Conflict - Resource conflict
- `422` — Unprocessable Entity - Validation error

---

[API](https://skmtc.net/mistral/apis/mistral-ai-api.md) · [All operations](https://skmtc.net/mistral/apis/mistral-ai-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/mistral/mistral-ai-api/revisions/61436a496404/schema)
