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

How to filter by Tag in 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
DynaMight Champion
DynaMight 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 Professional Certified

Featured Posts