v2

latestOpenAPI 3.1.0raw.githubusercontent.com2026-02-1261033.5 KB

Range query

Evaluate a PromQL expression over a range of time, returning a matrix of time series with regularly spaced samples.

The expression is evaluated at each step interval between start and end (both inclusive). The result is always a matrix (resultType: "matrix"), where each series contains an array of [timestamp, value] pairs spaced by step.

Also accepts POST with a application/x-www-form-urlencoded body containing the same parameters.

get/api/v1/query_range

Query parameters

querystring required

PromQL expression to evaluate at each step. Typically a rate or aggregation function (e.g. rate(http_requests_total[5m])), but any valid PromQL expression is accepted.

startstring required

Start timestamp (inclusive) of the evaluation range. Accepts RFC 3339 (e.g. 2024-01-20T00:00:00Z) or Unix seconds with optional decimal precision (e.g. 1705708800).

endstring required

End timestamp (inclusive) of the evaluation range. Accepts RFC 3339 or Unix seconds. Must be greater than or equal to start.

stepstring required

Query resolution step width — the interval between consecutive evaluation points. Can be a duration string (e.g. 15s, 1m) or a float number of seconds (e.g. 15, 60.0). Smaller steps produce more data points but increase query cost.

timeoutstring

Evaluation timeout. If the query does not complete within this duration, it is aborted and a 503 error is returned. Duration string such as 30s, 1m, or 2h. The server may cap this value with its own configured maximum.

Response

Range query result. Always returns resultType: "matrix" with an array of time series, each containing regularly spaced [timestamp, value] pairs. Series are sorted by their metric label set.

status'success' | 'error' required
errorstring

Human-readable error message (present when status is error).

errorTypestring

Error category (present when status is error): bad_data, internal, or unavailable.

warningsstring[]

Non-fatal warnings from the query engine. May be present even when status is success.