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.
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.
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.
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.
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"] pairmatrix: array of { metric, values } objectsstring: a single [timestamp, "string"] pairResponse envelope for an instant query (/api/v1/query). On success,
data contains the query result. On error, error and errorType
describe the failure.
success, error Result payload for an instant query. The resultType indicates the
shape of result:
vector: An array of { metric, value } objects — one per
matching time series. This is the most common result type for
instant queries on selectors and functions.matrix: An array of { metric, values } objects — returned
when the expression produces a range vector (e.g. using a
subquery).scalar: A single [timestamp, "value"] pair — returned for
pure numeric expressions like 1 + 1.string: A single [timestamp, "string"] pair — returned
for string literals.Human-readable error message (present when status is error).
Error category (present when status is error):
bad_data, internal, or unavailable.
Non-fatal warnings from the query engine, such as partial
results due to unavailable shards. May be present even when
status is success.