Query Range

Query Range

Executes a PromQL query over a specified time range and returns the result.

Request
URI
GET
https://{api_host}/api/v1/query_range
COPY
Query Parameters
string
query
Required

The PromQL query for execution.

query example
jvm_gc_collection_seconds_count{service="server"}
string
sourceId
Optional

Source Id against which we need to query data for, like VC Instance UUID, NSX Id etc.

string
timeout
Optional

Evaluation timeout in duration.

timeout example
1s
string
start
Required

Start timestamp in Unix epoch seconds or RFC3339 format.

start example
1739780198
string
end
Required

End timestamp in Unix epoch seconds or RFC3339 format.

end example
1739780198
string
step
Required

Query resolution step width in duration format or float number of seconds.

step example
1s
integer
limit
Optional

Maximum number of returned series. Doesn't affect scalars or strings but truncates the number of series for matrices and vectors. If not set, default limit is applied.

limit example
100
string
externalTagsFilter
Optional

Additionally passed tag filters which are needed to be applied on provided promql in request.


Authentication
This operation uses the following authentication methods.
Responses
200

OK.

Returns PrometheusResponse of type(s) application/json
{
    "status": "string",
    "data": {},
    "pageInfo": {
        "nextPageToken": "eyJuYW1lIjoiY3B1LnVzYWdlIiwidGltZXN0YW1wIjoxNjAwMDAwMDAwfQ==",
        "pageSize": 50
    },
    "errorType": "string",
    "error": "string",
    "warnings": [
        "string"
    ],
    "infos": [
        "string"
    ]
}
string
status
Required

API execution status.

Possible values are : success, error,
object
data
Required

Loose object reference for circumventing OpenAPI Generator's oneOf() problem for client SDK

object
pageInfo
Optional

Pagination metadata for paginated responses.

string
errorType
Optional

Type of an error. This field is set only if status is "error". The data field may still hold additional data.

string
error
Optional

Error while querying to the metrics. This field is set only if status is "error". The data field may still hold additional data.

array of string
warnings
Optional

Warnings generated during API execution. This field is set only if there were warnings while executing the request. The data field will still hold additional data.

array of string
infos
Optional

Info generated during API execution. This field is set only if there were info-level messages while executing the request.


400

Bad request.

Operation doesn't return any data structure

401

Unauthorized.

Operation doesn't return any data structure

403

Forbidden.

Operation doesn't return any data structure

422

Unprocessable Entity.

Operation doesn't return any data structure

503

Service Unavailable.

Operation doesn't return any data structure

Code Samples
COPY
                    curl -H 'Authorization: <value>' https://{api_host}/api/v1/query_range?query=value&start=value&end=value&step=v