Run a PromQL range query

  • POST GET /_prometheus/{index}/api/v1/query_range
  • POST GET /_prometheus/api/v1/query_range
Auth

Evaluate a PromQL expression over a time range and return matrix data. The endpoint mirrors the Prometheus /api/v1/query_range endpoint.

Required privileges

Index
read

Path parameters

index string optional

An index expression that restricts which indices are considered, for example metrics-generic.prometheus-*. If you omit it, the default expression metrics-* is used. Only indices with index.mode: time_series are considered.

Leave it out to use /_prometheus/api/v1/query_range.

Query parameters

query string required

The PromQL expression to evaluate.

start string required

The start of the range, as an RFC 3339 timestamp or Unix time in seconds.

end string required

The end of the range, as an RFC 3339 timestamp or Unix time in seconds.

step string required

The resolution between samples, as a number of seconds or a duration such as 30s or 1h30m.

limit number

The maximum number of series to return. 0 means no limit from the request.

timeout string

The evaluation timeout, as a number of seconds or a duration such as 30s. It must be positive and is capped by the xpack.prometheus.query.timeout cluster setting.

Responses

application/json
status string required

The status of the request: success.

data object required
resultType string required

The type of the result: vector for an instant query, matrix for a range query.

result object[] required

The result series. Sample values are JSON strings, including NaN, +Inf and -Inf.

warnings string[]

Warnings, such as a notice that the results were truncated because of limit.