31 May 2020 08:10 AM - last edited on 27 Mar 2023 11:33 AM by MaciejNeumann
Iam trying to pull the Availability % of a Dynatrace Monitor through time series API.
Iam using the below query.
https://mySampleEnv.live.dynatrace.com/api/v1/timeseries/com.dynatrace.builtin:syntheticmonitor.availability.percent?includeData=true&relativeTime=2hours&queryMode=TOTAL&entity=SYNTHETIC_TEST-safd2234234234
When I run this query the output that is returned is for all the locations and the value at different time intervals.
I need an aggregated value of availability % for a monitor.
Is there a way to aggregate and get a single output which say x% is the availability % of my Monitor in last 2 Hours.
I don't want the value % for each individual location for the time frame.
Please suggest/help.
Solved! Go to Solution.
31 May 2020 10:46 AM - last edited on 16 Oct 2023 03:26 PM by random_user
I believe using "resolution=Inf" is what you need.
Seems very similar to the problem I experienced before:
04 Jun 2020 08:17 AM
Thanks for confirming.
Can you please confirm the source for the below metric. Though the query is returning results curious to know the source/documentation for the below metric. I searched in v1 and v2 metrics section. Don't see the documentation for the metric. Please confirm
synthetic.browser.availability.location.total
04 Jun 2020 09:53 AM - last edited on 27 Mar 2023 11:33 AM by MaciejNeumann
Yes, I use mainly v2. You should get your values with something like below, just put in the tenant (yyyy...) and Api Token (zzzzzzz...):
curl -X GET "https://yyyyyy.live.dynatrace.com/api/v2/metrics/query?metricSelector=builtin%3Asynthetic.browser.availability.location.total&resolution=Inf&from=1589760000000&to=1589846400000" ; -H "accept: application/json; charset=utf-8" -H "Authorization: Api-Token zzzzzzzzzzzzzzzzzzzzzzzzz"
The doccumentation is available in the following locations:
https://www.dynatrace.com/support/help/dynatrace-api/environment-api/metric-v2/
https://yyyyyy.live.dynatrace.com/rest/v2/rest-api-docs/v2/spec3.json
11 Jun 2020 09:07 AM
Thanks for the details. I checked both the sources. But still I don't see this metric in these documentation. Can you please confirm.
Now Iam trying to find the equivalent metric for HTTP Monitor.
I don't see any built-in metrics for Synthetic monitors when I check for V2 metrics. Please help
11 Jun 2020 11:12 AM
If you want to know all metrics, the best way is to query the list of metrics. This can be done by issuing the following API calls below. You should replace with your environment and API token. Please also notice that nextPageKey should be different, and if you've not done this before, look for it in the beginning of the reply of the first call:
Looks like you need to use "builtin:synthetic.http.availability.location.total" but I have never used that before, as I don't have HTTP monitors.