v2

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

Instant query

Evaluate a PromQL expression at a single point in time.

The result can be a vector (set of instant samples), a scalar, a string, or even a matrix depending on the expression type. The resultType field in the response indicates the shape of the result array.

If time is omitted the server uses the current server time. Also accepts POST with a application/x-www-form-urlencoded body containing the same parameters.

get/api/v1/query

Query parameters

querystring required

PromQL expression to evaluate. This can be any valid PromQL expression including selectors (up{job="node"}), functions (rate(http_requests_total[5m])), aggregations (sum by (job) (up)), or arithmetic.

timestring

Evaluation timestamp — the point in time at which the expression is evaluated. Accepts RFC 3339 (e.g. 2024-01-20T00:00:00Z) or Unix seconds with optional decimal precision (e.g. 1705708800 or 1705708800.123). Defaults to current server time when omitted.

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

Successful query result. The data.resultType field indicates the shape of data.result:

  • vector: array of { metric, value } objects (most common for instant queries)
  • scalar: a single [timestamp, "value"] pair
  • matrix: array of { metric, values } objects
  • string: a single [timestamp, "string"] pair
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, such as partial results due to unavailable shards. May be present even when status is success.

All 6 operations