05 Feb 2024 01:44 PM - last edited on 08 Aug 2024 02:27 PM by Michal_Gebacki
I am new to Dynatrace API's , we have one use case were currently our team is manually retrieving the service calls count from Dynatrace UI every 15 days from view web request options provide in UI.
Instead of manual work we are planning to automate this process using one program which will communicate to Dynatrace API's and will return the data, but i am not sure which API's need to be used .
Note:- Team search the entity in webservices search box user application observability section using controller class name (that is how the services is configured in Dynatrace)
Solved! Go to Solution.
05 Feb 2024 01:49 PM
You can query the metrics using Metrics v2 API easily. Don't forget it is possible to query multiple metrics in one single call (request count and failed request count for example).
05 Feb 2024 02:05 PM
Sorry for asking basic questions !
Which metricKey need to be used in query to get the service calls count for each endpoint expose by individuals services?
where to pass the displayName of the service ?
05 Feb 2024 02:49 PM - edited 05 Feb 2024 02:54 PM
Sure, you find the list of builtin metrics here: https://docs.dynatrace.com/docs/shortlink/built-in-metrics#services you probably want builtin:service.requestCount.total
If you need to find your services by display name, use the entitySelector parameter, such as:
type(service),entityName.equals("MyService")
For more info on Entity Selectors see it's documentation page.
06 Feb 2024 01:24 PM
Sorry to bother you again!
I did try to create the query/url but did not get success😶
Can you please help me create query/url for below inputs.
In UI getting requests count.
Notes: In above picture process group name is web service name
Thanks
07 Feb 2024 07:16 AM - edited 07 Feb 2024 07:21 AM
But that's not a service name in your screenshot, but a process group name. Basically, you want parameters like this:
metricSelector: builtin:service.requestCount.server:splitBy("dt.entity.service"):auto
entitySelector: type(service),fromRelationship.runsOn(type(PROCESS_GROUP),entityName.equals("PG1")),tag("CF Space:PROD")
However with metrics you can't have it split by the webservice:method. If this is required, you need to define all your service methods as key requests or define calculated metrics. If you are on SaaS with Grail, then it will soon be possible to get this data using DQL when traces on grail are available.
Another solution is to export that in the MDA (what you have in your screen), on the bottom there is a menu for that: