GraphQL API limits
Look up the row, selected-field, and retention bounds of a GraphQL API query, the error past each one, and the time interval of aggregated rows.
The GraphQL API applies fixed bounds to every query: the rows it returns, the fields it selects, and how far back raw data goes. The length of the time range also sets the time interval of each row an aggregated query returns.
Query bounds
A query past a row or field bound returns HTTP 400, with the message in the detail key of a JSON body, not in a GraphQL errors array. Raw data older than the retention period returns no error:
| Scope | Limit | Past the limit |
|---|---|---|
Rows per query, set by limit | 0 to 10,000 rows | 400 with The value for the query limit is invalid (must be between 0 to 10000 rows). |
| Selected fields, datasets of the metrics endpoint | 37 fields | 400 with You have exceeded the limit amount allowed for selected fields (37 fields). |
Selected fields, workloadEvents | 36 fields | At 37 fields, 400 with The query has reached a system limit. Please adjust your query and try again. At 38 or more, 400 with the 37-field message. |
| Raw data on the events endpoint | About 7 days | The query returns 200 with the records inside the retention period and none older. |
Without limit, a query returns 10 rows. The offset argument, 0 by default, sets how many rows the API skips before it returns them. The output field of an aggregate function, such as sum, does not count toward the 37 fields: a workloadMetrics query that selects ts, 36 other fields, and sum succeeds.
On workloadEvents, the 37th field returns the system-limit message whatever the field and the time range. For example, a workloadEvents query that selects 37 fields fails, and the same query at 36 fields succeeds.
This query asks for 10,001 rows:
The API refuses it with 400 and this body:
Every message the API returns, with its cause, is on Error responses.
Time interval of aggregated rows
An aggregated query on the metrics endpoint returns rows grouped into time intervals. The adaptive resolver sets the interval from the length of the time range, so a longer range returns fewer, wider rows:
| Time range length | Interval of each row |
|---|---|
| Up to about 2 days | 1 minute |
| From 60 hours | 1 hour |
| From about 60 days | 1 day |
For example, a range of 48 hours or less returns one row per minute, such as 13:34:00, and a range of 59 days returns one row per hour. The switch to a wider interval returns no error.
This query sums the requests of a 61-day range per interval, latest first:
The response holds one row per day:
For the query shape, refer to Queries.