Evaluates query over range of time.

POST {{baseUrl}}/query_range?query=num_threads&start=2023-02-13T09:48:43Z&end=2023-02-14T09:48:43Z&step=15s

The following endpoint evaluates an expression query over a range of time

You can URL-encode these parameters directly in the request body by using the POST method and Content-Type: application/x-www-form-urlencoded header. This is useful when specifying a large query that may breach server-side URL character limits.

The data section of the query result has the following format { "resultType": "matrix", "result": <value> } For the format of the <value> placeholder, see the range-vector result format.

Request Params

KeyDatatypeRequiredDescription
querystring(Required) Prometheus expression query string.

Example: ?query=up | | start | string | | Start timestamp.

Example: &amp;start=2015-07-01T20:10:30.781Z | | end | string | | End timestamp.

Example: &amp;end=2015-07-01T20:11:00.781Z | | step | string | | Query resolution step width in duration format or float number of seconds.

Example: &amp;step=15s | | timeout | string | | Evaluation timeout. Optional. Defaults to and is capped by the value of the -query.timeout flag.

Example: ?metric=http_requests_total |

HEADERS

KeyDatatypeRequiredDescription
Acceptstring

RESPONSES

status: OK

{&quot;status&quot;:&quot;success&quot;,&quot;data&quot;:{&quot;resultType&quot;:&quot;matrix&quot;,&quot;result&quot;:[{&quot;metric&quot;:{&quot;__name__&quot;:&quot;up&quot;,&quot;job&quot;:&quot;prometheus&quot;,&quot;instance&quot;:&quot;localhost:9090&quot;},&quot;values&quot;:[[1435781430.781,&quot;1&quot;],[1435781445.781,&quot;1&quot;],[1435781460.781,&quot;1&quot;]]},{&quot;metric&quot;:{&quot;__name__&quot;:&quot;up&quot;,&quot;job&quot;:&quot;node&quot;,&quot;instance&quot;:&quot;localhost:9091&quot;},&quot;values&quot;:[[1435781430.781,&quot;0&quot;],[1435781445.781,&quot;0&quot;],[1435781460.781,&quot;1&quot;]]}]}}