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

How to filter by Tag in Dynatrace Metrics API

Shruts
Participant

Hi,

I'm trying to fetch data using metrics API as I mentioned API request URL below:

https://{environmentid}.live.dynatrace.com/api/v2/metrics/query?metricSelector=builtin%3Aservice.err...

Here I'm trying to pass entitySelector as tag which is giving me incorrect entitySelector response.
My tag value is CST01. Please help me how to pass tag value in request URL

2 REPLIES 2

victor_balbuena
Dynatrace Mentor
Dynatrace Mentor

For an entity seleector to work, you normally have to provide the type predicate as well, or the scope of the entity selector will be too wide. So something like this should work instead:

entitySelector=type(SERVICE),tag(CST01)

 

gbaudart
Champion

hi @Shruts 

You may found more information in this post : https://community.dynatrace.com/t5/Dynatrace-API/API-V2-tags-filter/m-p/164742

Observability consultant - Dynatrace Associate Certified

Featured Posts