cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Looking to upgrade from Dynatrace Managed to SaaS? See how

Metrics to fetch services specific to a host tag

ushaghosh
Participant

I would like to filter out all  the services based on a host tag, what query would help me fetch that info.

Fetch problems based on host tag.

My managemnet zone has 9 environmnets. I would like to segregate them based on a host tag that I defined on the host. 

4 REPLIES 4

StrangerThing
DynaMight Advisor
DynaMight Advisor

You can do something like this to get a list of services where the hosts that run them have a certain tag.

fetch dt.entity.service
| expand dt.entity.host=runs_on[dt.entity.host]
| fieldsAdd entityAttr(dt.entity.host, "tags")
| filter matchesPhrase(dt.entity.host.tags, "App:apptag")
| dedup id
| fields entity.name, id

Observability Engineer at FreedomPay

ushaghosh
Participant

I do not see this option in my managed deployment. For me it starts with builtin:

Hello @ushaghosh,
Dynatrace Managed doesn't use DQL, as the Grail technology is available for customers using Dynatrace SaaS. I'll move your question to the Managed forum, as maybe someone there will be able to help solve your use case. 

If you have any questions about the Community, you can contact me at maciej.neumann@dynatrace.com

mark_bley
Dynatrace Champion
Dynatrace Champion

you will need an entity selector like this one 

type("SERVICE"),fromRelationships.runsOnHost(type(HOST),tag("[Azure]tenant:CustomerA"))

(you can try it out on the monitored entities api endpoint)

Or you can directly use it on a metric line:

builtin:service.response.client
:filter(
in("dt.entity.service",entitySelector(
    "type(SERVICE),fromRelationships.runsOnHost(type(HOST),tag(~"[Azure]tenant:CustomerA~"))"
))
)
:splitBy("dt.entity.service"):sort(value(auto,descending)):limit(20)

 

Featured Posts