11 Oct 2022 08:53 PM - last edited on 20 Aug 2024 03:13 PM by Michal_Gebacki
Hi
I am trying to get the max value of metric data point using API for last 1 hour. I want the exact timestamp returned in response. But I am always getting the timestamp as to value I framed in query. In the below example I am getting timestamp as 2022-10-11T10:00:00.
https://abc.live.dynatrace.com/api/v2/metrics/query?metricSelector=builtin:host.cpu.usage:fold(max):filter(or(eq(%22dt.entity.host%22,%22HOST%22)))&from=2022-10-11T00:00:00.000%2B05:30&to=2022-10-11T10:00:00.000%2B05:30
response:
Please help me to overcome this problem
Thanks!
Solved! Go to Solution.
12 Oct 2022 06:43 AM
The finest resolution that Dynatrace is able to provide is 1 minute. You will not be able to get the exact timestamp in seconds, milliseconds, etc.; because Dynatrace does not store it.
If minute resolution is good enough for you, you can request it by using the resolution parameter: https://www.dynatrace.com/support/help/shortlink/api-metrics-v2-get-datapoints#parameters