dynatrace

Query request count for a each endpoint in rest controller


I have Dynatrace agent attached to my Spring-Boot app with multiple rest controllers. Each rest controller has multiple API endpoints.

I have the following query to get total request counts for rest controller with entityId = "SERVICE-A9876543210" (for all API endpoints)

GET https://{environmentId}.live.dynatrace.com/api/v2/metrics/query
?metricSelector=builtin:service.requestCount.total
&resolution=1m
&from=-10m
&to=now
&entitySelector=entityId("SERVICE-A9876543210")

How can I alter this query to get request count for each API in given rest controller?


Solution

  • You can change the entitySelector, there are multiple options.
    You could add all the services manually by ID, use a Tag that's on all the services or select them by the Process Group if you want all services of that PG.

    EDIT: Misread the question. If you want information about the request counts of all endpoints of a given controller, that's not available as a metric by default. Only on service level.

    You can create a custom service metric that is split by the request name to get what you want.