How to filter by Tag in Metrics API

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.errors.fivexx.count&entitySelector=tag%28%22CST01%22%29&mzSelector=mzName%28%22Autofix-Openreach_APP11319%22%29

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

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)

hi @Shruts

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