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

Get Service Method and call numbers

Cespo
Newcomer

Hi all,

I'm new on Dynatrace API and I'm trying to get automatically the same information I see on UI.

In particular I'd like to get, for any service on a host, the list of service methods with the number of requests (the same information I can see in the screenshot below). 

Cespo_0-1623663810070.png

 

Using

/api/v1/entity/infrastructure/processes?host="Host-Id"

I've the list of services on host but I haven't found an API to get the service method list.

With this info I think I can use the metric "com.dynatrace.builtin:servicemethod.responsetime" but without the service method entity id I'm stucked.

Could you help me?

 

Thanks a lot!

Cespo

 

4 REPLIES 4

trevor_masseng1
Dynatrace Mentor
Dynatrace Mentor

Hi Cespo,

 

In order to pull response time data out of Dynatrace per request, you have to mark the requests that you want to pull as key requests.

 

Performance data for requests is aggregated at the service level and stored for that service in a manner that the Metrics API can query. Marking a request as a key request makes Dynatrace store performance data for just that request separately as well, so it can be viewed for a longer period of time and queried through the APIs.

 

Once you mark your request as a key request, you can use the below API to pull response time data:
https://www.dynatrace.com/support/help/dynatrace-api/environment-api/metric-v2/get-data-points/

 

The below endpoint should be what you are looking for:

/api/v2/metric/query?metricSelector=builtin:service.keyRequest.response.time


All of the available metrics for Key Requests are on this page:

https://www.dynatrace.com/support/help/shortlink/api-metrics2-available-saas#service-keyRequest

 

Hi trevor_masseng1,

thanks for your reply. I've understood I need to set response.time and count.total as key requests before do any query.

But, if key requests are aggregated at the service level I've to set key requests for any service on any server?

In my case I've 5 servers and each server host about 300 services (with an average of 30 service methods each). I've to set key requests on any service of any server?


Thanks for your time

Cespo

So response.time and count.total are metrics. What you want is to set SearchCustomer as a key request, then the SearchCustomer request will be given its own performance metrics aside from the service.
If all of the services are named the same and belong to the same process group, then changing Search Customer to a key request for one service should change them for all hosts.

Otherwise, you'll have to do this for each request and service pairing you want to pull data for.

Hi trevor_masseng1,

now it's clear. Some services have the same name on different hosts and others do not.
I understood that I have to list the services and retrieve all the unique names and for each of them set Search Customer as a key request.


Thanks for all your help!
Cespo 

Featured Posts