v1

latestOpenAPI 3.0.02026-07-141,4077,1665.2 MB
Spans

Aggregate spans

The API endpoint to aggregate spans into buckets and compute metrics and timeseries. This endpoint is rate limited to 300 requests per hour.

post/api/v2/spans/analytics/aggregate

Request body

Example request

{
  "data": {
    "attributes": {
      "compute": [
        {
          "aggregation": "pc90",
          "interval": "5m",
          "metric": "@duration"
        }
      ],
      "filter": {
        "from": "now-15m",
        "query": "service:web* AND @http.status_code:[200 TO 299]",
        "to": "now"
      },
      "group_by": [
        {
          "facet": "host",
          "histogram": {
            "interval": 10,
            "max": 100,
            "min": 50
          },
          "sort": {
            "aggregation": "count",
            "order": "asc"
          }
        }
      ],
      "options": {
        "timezone": "GMT"
      }
    },
    "type": "aggregate_request"
  }
}

Response

OK

Example response

{
  "data": [
    {
      "attributes": {
        "by": {
          "@state": "success",
          "@version": "abc"
        }
      },
      "type": "bucket"
    }
  ],
  "meta": {
    "elapsed": 132,
    "request_id": "MWlFUjVaWGZTTTZPYzM0VXp1OXU2d3xLSVpEMjZKQ0VKUTI0dEYtM3RSOFVR",
    "status": "done",
    "warnings": [
      {
        "code": "unknown_index",
        "detail": "indexes: foo, bar",
        "title": "One or several indexes are missing or invalid, results hold data from the other indexes"
      }
    ]
  }
}