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

Timeseries Metrics Information for Availability Percentage

sanjiv1987
Guide

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.

 

 

 

5 REPLIES 5

AntonioSousa
DynaMight Guru
DynaMight Guru

I believe using "resolution=Inf" is what you need.

Seems very similar to the problem I experienced before:

https://community.dynatrace.com/spaces/482/dynatrace-open-qa/questions/238747/rfe-synthetic-apidoes-...

Antonio Sousa

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

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 

Antonio Sousa

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


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:

  • curl -X GET "https://yyyyyy.live.dynatrace.com/api/v2/metrics/?pageSize=1000" -H "accept: application/json; charset=utf-8" -H "Authorization: Api-Token zzzzzzzzzzzzzzzzzzzz"
  • curl -X GET "https://yyyyyy.live.dynatrace.com/api/v2/metrics/?nextPageKey=___a7acX3q0AAAAGAAEAAAAAAAAD6AAAAAAEAAECAwEAPmJ1aWx0aW46dGVjaC5lbGFzdGljc2VhcmNoLmxvY2FsLm5vZGUuYnJlYWtlcnMucGFyZW50Lm92ZXJoZWFkAP__2u2nF96t" -H "accept: application/json; charset=utf-8" -H "Authorization: Api-Token zzzzzzzzzzzzzzzzzzzz"

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.

Antonio Sousa

Featured Posts