cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Get exact timestamp in response

jay-udt
Visitor

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:

"timestamps": [
                        1665462600000
                    ],
                    "values": [
                        100
                    ]

 

Please help me to overcome this problem

 

Thanks!

1 REPLY 1

abbachr
Dynatrace Helper
Dynatrace Helper

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

Featured Posts