hi, I am trying to pull monthwise availability metrics of synthetic monitors from dynatrace using below query,
curl -X GET "https://abc.dynatrace.com/api/v2/metrics/query?metricSelector=builtin%3Asynthetic.browser.availabili..." -H "accept: application/json; charset=utf-8" -H "Authorization: Api-Token apiKey"
Issue: When i run this query, am getting availability metrics for 2 months instead of a month. For instance, i ran the above query today and got availability details for Jan and december instead of december. Need your inputs ni refactoring the above query to get monthwise data for a particular month.
Solved! Go to Solution.
If you want only a single value for the entire timespan, then you need either set the resolution to inf instead of 1M or use the :fold transformation in the metric selector
Thanks Julius. abovee solution worked.
Also, in response am getting date format as "1/1/2023 12:00:00 AM". Can i get it in different format like "23-Jan"?
API works with epoch timestamps. There is no way it returns a different format, maybe the tool which converts that epoch for you already?