If you request the data in CSV format you will get get a date/time format as seen in my screenshot below.
My example query looks like the following.
The docs for querying metrics can be found below with an example for the CSV format at the bottom.
Unfortunately I can't see a way to request the time in a date/time format when getting a response in json.
If you tied the application name to the synthetic with tags, as far as I can tell that isn't possible without making another request to get the details on the synthetic in question. Using the returned synthetic ID you can query the synthetic API to get all details including tags.
Below is an example
I am using below curl request to pull synthetic monitors availability metrics for a month.
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"
When i run this query today, am getting data for march month. what should i update in the query to get previous month (FEb month)availability data?
You need to modify the timeframe selector in your query. There is a cheat sheet for it in DT when you expand the selector input. I would suggest reading into the examples in there as well as looking into the docs as it's very useful for building out complex dashboards and reports relying on the API.
What you're looking for is "&from=now-1M/M&to=now/M" which specifies from now minus 1 month, then rounding to the nearest month. Then it goes to now rounded to the nearest month. So it would round from the beginning of Feb to the beginning of March.
No! currently there is no way you can get that response change from api. You can use a post processor script.
Also check this solution if helps