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

Metrics Query API

Balamurugesh
Contributor

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?

 

 

 

1 REPLY 1

JamesKitson
Dynatrace Guru
Dynatrace Guru

I'll refer to the answer just posted here.

 

The API Explorer lets you set the values for the timeframes and includes some tips:

JamesKitson_0-1652970231542.png

 

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>"