---
title: "Query project runtime metrics"
method: POST
path: "/projects/{id}/metrics/query"
tags: ["Projects"]
---

# Query project runtime metrics

`POST /projects/{id}/metrics/query`

## Request

- Base URL: `https://api.volcano.dev`
- URL: `https://api.volcano.dev/projects/{id}/metrics/query`
- Auth: one of:
  - HTTP bearer
  - HTTP bearer

Evaluates a batch of named, curated runtime metric queries over one
trailing time range. Query IDs correlate each request with its result;
raw backend query languages are intentionally not exposed.

## Path parameters

- `id` string, uuid, required

## Request body

- ProjectMetricsQueryRequest
  - `time_range` ProjectMetricsQueryTimeRange, required
    - `window` '30m' | '1h' | '24h' | '7d', required
  - `queries` ProjectMetricsQuery[], required
    - `id` string, required
    - `metric` 'request_count' | 'server_error_count' | 'availability' | 'p95_latency', required
    - `group_by` 'region' | 'resource_type'

## Response `200`

Project runtime metric queries evaluated

- ProjectMetricsQueryResponse
  - `observed_at` string, date-time, required
  - `fresh_through` string, date-time
  - `window` ProjectMetricsWindow, required
    - `from` string, date-time, required
    - `to` string, date-time, required
  - `results` ProjectMetricsResult[], required
    - `id` string, required
    - `metric` 'request_count' | 'server_error_count' | 'availability' | 'p95_latency', required
    - `unit` 'count' | 'ratio' | 'seconds', required
    - `data_status` 'complete' | 'partial' | 'no_data', required
    - `values` ProjectMetricsValue[], required
      - `dimensions` ProjectMetricsDimensions, required
        - `region` string
        - `resource_type` 'function' | 'frontend'
      - `value` number, double, required

## Other responses

- `400`: Invalid metric query
- `401`: Unauthorized - invalid or missing token
- `403`: Access denied
- `404`: Project not found
- `500`: Internal server error
- `503`: Runtime metrics backend unavailable

## Changes

- **2026-10-07** `23e7875e7c4c`: 1 info
  - the endpoint scheme security `ProjectAccessToken` was added to the API
- **2026-09-19** `3a6f365f3f35`: 11 breaking, 16 info
  - added the new path request parameter `id`
  - added the new required request property `queries`
  - added the new required request property `time_range`
  - the request's body type changed from no type to `object`
  - …23 more
- **2026-08-27** `bb44e98aba2e`: 17 breaking, 10 warning
  - the request's body type changed from `object` to no type
  - the response's body type changed from `object` to no type for status `200`
  - the response's body type changed from `object` to no type for status `400`
  - the response's body type changed from `object` to no type for status `401`
  - …23 more
- **2026-07-27** `bb52784e098a`: 6 info
  - added the optional property `code` to the response with the `400` status
  - added the optional property `code` to the response with the `401` status
  - added the optional property `code` to the response with the `403` status
  - added the optional property `code` to the response with the `404` status
  - …2 more

[Operation history](https://skmtc.dev/kong/apis/volcano-api/changes/projects/:id/metrics/query/post.md)

---

[API](https://skmtc.dev/kong/apis/volcano-api.md) - [All operations](https://skmtc.dev/kong/apis/volcano-api/llms.txt) - [OpenAPI document](https://skmtc.dev/kong/apis/volcano-api/revisions/84c4488f91e9?raw)
