20 Sep 2021 08:10 PM - last edited on 31 May 2023 12:51 PM by Michal_Gebacki
I'm wanting to pull metrics from dynatrace for keyRequest using a tag value instead of the SERVICE_METHOD ID.
Here's my example:
/api/v2/metrics/query/?entitySelector=type(SERVICE_METHOD),
entityId(SERVICE_METHOD-123456)&
metricSelector=builtin:service.keyRequest.response.time:merge(0):percentile(90)&
from=1632101783000&
resolution=Inf&
to=1632106514000
How would I replace the SERVICE_METHOD ID using a tag value?
Solved! Go to Solution.
21 Sep 2021 04:31 PM - edited 21 Sep 2021 04:32 PM
Hello,
It is something I would like to get too. I tried using the "tag" filed:
entitySelector("type(service_method),tag(~"WCSCMS - CMS~")")
The parameter is accepted but it is not working. I don't understand if DT will allow to perform this query in the future (like the old Metric API allowed you to do) or if they decided to totally remove this feature.
For the moment, if it helps you can filter by Keyrequest name:
entitySelector("type(service_method),entityName(~"KEYREQUESTNAME~")")
23 Sep 2021 03:45 PM
Your recommendation works great! Now that I can see metrics for keyRequest is it possible to use a filter on parent service to get keyRequest metrics? The reason I ask is if there are duplicate keyRequest names in dynatrace for two different services.
Example: give me the keyrequest with name "createOrder" from my parent service that is called "order-service".
24 Sep 2021 11:50 AM
They use case you are describing is exactly the reason why filtering by tag make a lot of sense. Unfortunately it seems they decided to remove it...the only workaround is to change the name of the keyrequest sharing the same name I suppose