Evaluates instant query

GET {{baseUrl}}/query?query=num_threads

The following endpoint evaluates an instant query at a single point in 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" | "vector" | "scalar" | "string", "result": <value> } <value> refers to the query result data, which has varying formats depending on the resultType. See the expression query result formats.

Request Params

KeyDatatypeRequiredDescription
querystring(Required) Prometheus expression query string.

Example: ?query=up | | time | string | | Evaluation timestamp. Optional.

The current server time is used if the time parameter is omitted.

Example: ?metric=http_requests_total | | 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;vector&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;value&quot;:[1435781451.781,&quot;1&quot;]},{&quot;metric&quot;:{&quot;__name__&quot;:&quot;up&quot;,&quot;job&quot;:&quot;node&quot;,&quot;instance&quot;:&quot;localhost:9100&quot;},&quot;value&quot;:[1435781451.781,&quot;0&quot;]}]}}