28 Jun 2022
10:04 AM
- last edited on
27 Mar 2023
10:26 AM
by
MaciejNeumann
https://xxxxxxxx.live.dynatrace.com/api/v2/metrics/query?metricSelector=builtin:host.cpu.gcpu.usage:names,builtin:host.cpu.msu.avg:names,builtin:host.cpu.msu.capacity:names,builtin:host.cpu.ziip.eligible:names,builtin:host.cpu.entConfig:names,&from=1652853660000&to=1652940060000&resolution=60m
For above request we are getting 876KB of data.
So we need pagination support.
We are getting results like this without pageSize param.
{
"totalCount": 1292,
"nextPageKey": null,
"resolution": "1h",
...
}
Even in above uri if I add pageSize param with values 50,75 and 100 there is no change in response and size of data returned. Still nextPageKey is null.
How to make pagination working so that we get nextPageKey so that we can navigate using nextPageKey.
Solved! Go to Solution.
28 Jun 2022 11:58 AM
Pagination is not supported for this API.
As you can read in the documentation, the nextPageKey attribute is deprecated and only included in the JSON response for backwards compatibility purposes.
If the total payload you are extracting is too large, one suggestion is to break up the metric query into multiple queries (using the "from" and "to" query parameters to divide into smaller timeframes).
I hope this helps.
Radu