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

Get Dashboard data with Dynatrace Environment API 2.0

jcamps
Advisor

Hi all,


we have one Dashboard with the response time from several services:


i want to get this information via REST API restricted to several timeframes. To do this one option (maybe not the best) was the Dynatrace Environment API 2.0 with the /metrics/query option.

I put in the metricSelector the value builtin:service.response.time and in the entitySelector I've to put the dashboard or the tile in the dashboard, ¿how can I specify it?

Regards, Josep Maria

3 REPLIES 3

Radoslaw_Szulgo
Dynatrace Leader
Dynatrace Leader

Hi,

I guess you should rather use entity IDs or tags whatever works for you. So you implement a REST query similar to what you build in the custom chart. Have a look on my example how I got CPU wait time metric for a given service:

api/v2/metrics/query?metricSelector=builtin%3Aservice.cpu.time&entitySelector=type%28SERVICE%29%2CentityId%28SERVICE-CC5FE0610A39BEF5%29" -H "accept: application/json; charset=utf-8"


More info here: https://www.dynatrace.com/support/help/extend-dynatrace/dynatrace-api/environment-api/metric-v2/get-...

Technical Product Manager,
Dynatrace Managed expert

Hi @Radoslaw S.,


thanks for your response, but there's no type for the entity Dasboard? We've several dashboards with several filters and we've to provide this data via API.

To do that, the simplest way was to specify the dashboard or the tile inside the DB in the entitySelector?

Regards, Josep Maria


There's no entity Dashboard - it's just a way of displaying the data, you might say.

As written in my comment, you can get exactly same data by the /query REST API and specifying same entities that you specify for you custom chart.

Technical Product Manager,
Dynatrace Managed expert