28 Apr 2021 11:55 AM - last edited on 21 Aug 2024 11:20 AM by Michal_Gebacki
Hi,
We have a service that is called by a dozen consumers all of which are monitored by Dynatrace. I am trying to find a way to get the count of service calls done by each service consumer. I have got as far as setting up the REST API query below however I cannot seem to find any way to group the results by the ClientIP or client host name. Please can someone assist?
https://###/e/###/api/v2/metrics/query?metricSelector=builtin%3Aservice.requestCount.total,builtin:service.successes.server.rate&entitySelector=type(SERVICE),entityId(SERVICE-B3D4BBE30B3CE27A)&from=now-1h&resolution=h
Solved! Go to Solution.
28 Apr 2021 01:58 PM
Currently, I do not believe there is an out of the box way to do this.
This could be possible if you created a request attribute, capturing either client IP address, a request or response header (if the source or service is tracked in a header), or some other Java/.NET method parameter (again, if this is available in the code).
Next, you would want to create a calculated service metric around this value that you captured for you to split by, the metric should be request count based.
Then you would want to use the metrics api to query the new metric you created. This does consume DDUs (0.001 * splittings * services that this metric applies to * frequency). There are options when creating this type of metric to isolate it to a group or single service.