Evaluates a range query in a metrics account by ID using POST
POST/v1/metrics/prometheus/:accountId/api/v1/query_range
Runs against the metrics account given by accountId instead of the API token's own account, so it can be called with the API token of a logs account. The token's account must be one of the metrics account's authorized accounts, otherwise the request returns 401. To list the metrics accounts and their authorizedAccountsIds, use Get a list of all metrics accounts.
Submit query data in the request body using URL-encoded form parameters. Please ensure to change the region in the URL to match your account's region.
Request
Path Parameters
ID of the metrics account to query.
- application/x-www-form-urlencoded
Body
required
Prometheus expression query string.
Start timestamp, inclusive, as an RFC3339 or Unix timestamp.
End timestamp, inclusive, as an RFC3339 or Unix timestamp.
Query resolution step width in seconds.
Evaluation timeout. Optional, defaults to the value of the -query.timeout flag.
Responses
- 200
- 400
- 401
- 500
Successful range query evaluation.
- application/json
- Schema
- Example (from schema)
Schema
- Array [
- ]
Status of the query (e.g., success, fail).
data object
Possible values: [matrix]
Type of the result.
result object[]
metric objectrequired
Labels identifying the metric.
Possible values: >= 2, <= 2
A list of [timestamp, value] pairs returned by the query.
{
"status": "string",
"data": {
"resultType": "matrix",
"result": [
{
"metric": {},
"values": [
[
"string"
]
]
}
]
}
}
Invalid request parameters.
The API token's account is not an authorized account of the metrics account accountId.
Internal server error.