Hi Team, I want to get the synthetic monitoring availability for all configured monitors for a month or year. I got to know that we can get it with metrics Query API. but am not sure about the timeframe and resolution i should pass while querying. Could you please provide the appropriate curl command to get these details?
Solved! Go to Solution.
I'll refer to the answer just posted here.
The API Explorer lets you set the values for the timeframes and includes some tips:
For 1 year you can enter now-1y in the from parameter. And the URL it sends and sample command displayed are updated accordingly:
curl -X GET "https://<dynatrace_hostname>/api/v2/metrics/query?metricSelector=builtin%3Asynthetic.browser.availability.location.total%3AsplitBy%28%22dt.entity.synthetic_test%22%2C%22dt.entity.geolocation%22%29&from=now-1y" -H "accept: application/json; charset=utf-8" -H "Authorization: Api-Token <api_token>"