Skip to Content
Docs

Query metrics

POST
/metrics

Authorization

jwt
headerAuthorizationBearer <JWT>

Request Body

application/json
  1. body
filter*
last?string
Match^-?\d+[dhm]$
from?string

An ISO 8601 date time string

Match^(?:\d+(?:\.\d+?)?|(?:\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?Z))$
Formatdate-time
to?string

An ISO 8601 date time string

Match^(?:\d+(?:\.\d+?)?|(?:\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?Z))$
Formatdate-time
rollup?
topN?integer
Range0 < value <= 100
rankBy?string
Value in"avg""max""sum"
limit*integer
Range0 < value <= 10000
Default10000
offset?integer
Range0 <= value <= 1000000
output*string
Default"timeseries"
Value in"timeseries""timeseries-by-pod""timeseries-by-direction""timeseries-by-group""timeseries-resource""timeseries-top-n""single""group""summary""summary-by-agent""summary-delta""table-aggregated""scalar""scalar-by-agent""current-state""agent-terminated-events"

Response Body

application/json
  1. response
[index: integer]?
Example Request
curl -X POST 'https://observability.your-tenant-id.my.contextual.io/api/v1/metrics' \  -H 'Content-Type: application/json' \  -d '{  "filter": {},  "limit": 10000,  "output": "timeseries"}'
Example Response
[  {    "timestamp": "2019-08-24T14:15:22Z",    "value": 0  }]