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

Synthetic monitoring Availability - Metrics API response

Balamurugesh
Guide

Hi Team,

 

I am trying to get monthwise availaibity metrics of synthetics monitors using Synthetic API, but in response, am getting timestamps in UNIX format. Is there is way to get it in DD-MM-YY format or human understandable format?

8 REPLIES 8

Fin_Ubels
Dynatrace Advisor
Dynatrace Advisor

Hey Balamurugesh,


If you request the data in CSV format you will get get a date/time format as seen in my screenshot below.

Fin_Ubels_1-1657687700301.png

 

My example query looks like the following.

Fin_Ubels_2-1657687835770.png

 

 

The docs for querying metrics can be found below with an example for the CSV format at the bottom.
https://www.dynatrace.com/support/help/dynatrace-api/environment-api/metric-v2/get-data-points#tabgr...

 

Unfortunately I can't see a way to request the time in a date/time format when getting a response in json.

thanks for the details. When i query metrics API, am getting monitor Id's in response. Is there a way to get monitorName instead of monitorId in response?

If you have a look at the screenshots I posted you can get the name by adding :names to your metric query. As you can see in the CSV response for my query the name of my http monitor is Recipe API.

hi Fin, I have tied each synthetic monitor with respective application. Am looking for application name as well in response. Is there a way to get the tied Application name in response? 

Regards,Dingu

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.
https://www.dynatrace.com/support/help/dynatrace-api/environment-api/synthetic/synthetic-monitors/ge...

 

Below is an example

Fin_Ubels_0-1658707438334.pngFin_Ubels_1-1658707481440.png

 

Is there any possibility to get the application details in metrics API call?

 

Not that I can find unfortunately unless you used a synthetic naming scheme that used the applications name since the synthetic name is provided in the query response.

techean
Dynatrace Champion
Dynatrace Champion

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

RFE in place RFE - Dynatrace API can specific timezone using relative timeframe parameters - Dynatrace Community

KG