# Tagging based on Services from a web application

**URL:** <https://community.dynatrace.com/t/tagging-based-on-services-from-a-web-application/34003>\
**Category:** Open Q&A\
**Tags:** services-classic, tagging\
**Created:** [February 3, 2022, 10:55am UTC](https://community.dynatrace.com/t/tagging-based-on-services-from-a-web-application/34003 "2022-02-03T10:55:43Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sten](https://avatars.discourse-cdn.com/v4/letter/s/73ab20/32.png) [@Sten](https://community.dynatrace.com/u/Sten)\
**Post date:** [February 3, 2022, 10:55am UTC](https://community.dynatrace.com/t/tagging-based-on-services-from-a-web-application/34003/1 "2022-02-03T10:55:43Z")

</div>

Hello,

I want to tag all services that belong to a specific Web Application so I can make a complete Management Zone based on the Web App.

So basically when I click on the services that belong to the web app, I can see the service flow and I want to tag all of those components.

Is this possible?

Thanks in advance!

Sten

---

<div class="post-metadata">

**Author:** ![r\_weber](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/r_weber/32/24884_2.png) [@r\_weber](https://community.dynatrace.com/u/r_weber)\
**Post date:** [February 3, 2022, 10:24pm UTC](https://community.dynatrace.com/t/tagging-based-on-services-from-a-web-application/34003/2 "2022-02-03T22:24:38Z")

</div>

Hi&nbsp;[@Sten](https://community.dynatrace.com/user/47626)&nbsp;,

yes this is possible. It’s not too straight forward though. You can use the relationships in entitySelectors to identify those services. See my [Pro Tip post here](https://community.dynatrace.com/topic/175701). Number 7 in that list is doing it the other way around (tag applications up from services, but if you use a “toRelationship” from the Application entitytype&nbsp; you should be able to achieve this.

I think the entitySelector would be:

```auto
type(SERVICE),toRelationships.calls(type(APPLICATION),tag(tagOfApplication))

```

You can use this selector in an auto tagging rule which would then also assign the same tag (tagOfApplication) to the services. And then further on use this tag in you MZ assignment rule.

Only drawback: you cannot use placeholders or key:value tags for entitySelector rules…

kr,

Reinhard

---

<div class="post-metadata">

**Author:** ![Sten](https://avatars.discourse-cdn.com/v4/letter/s/73ab20/32.png) [@Sten](https://community.dynatrace.com/u/Sten)\
**Post date:** [February 4, 2022, 12:50pm UTC](https://community.dynatrace.com/t/tagging-based-on-services-from-a-web-application/34003/3 "2022-02-04T12:50:05Z")

</div>

Hi Reinhard,

Thanks for your awesome reply! This is really nice knowledge.

Unfortunately, I can’t make it work on the environment. I made a tagging rule via the API as follows:

{  
“name”: “sampleAutoTag”,  
“description”: “sampleDescription”,

“entitySelectorBasedRules”: [  
{  
“enabled”: true,  
“entitySelector”: “type(SERVICE), toRelationships.calls(type(APPLICATION), tag(tagOfApplication))”  
}  
]  
}

This was succesful, however the tags of the Application are (45 minutes later) still not visible on the Services. Do you know what I’m doing wrong?

---

<div class="post-metadata">

**Author:** ![Sten](https://avatars.discourse-cdn.com/v4/letter/s/73ab20/32.png) [@Sten](https://community.dynatrace.com/u/Sten)\
**Post date:** [February 4, 2022, 1:45pm UTC](https://community.dynatrace.com/t/tagging-based-on-services-from-a-web-application/34003/4 "2022-02-04T13:45:11Z")

</div>

Update from my side: it works!! I need to specify the tag within the call at the place “tagOfApplication”&nbsp;😅

---

<div class="post-metadata">

**Author:** ![r\_weber](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/r_weber/32/24884_2.png) [@r\_weber](https://community.dynatrace.com/u/r_weber)\
**Post date:** [February 4, 2022, 7:45pm UTC](https://community.dynatrace.com/t/tagging-based-on-services-from-a-web-application/34003/5 "2022-02-04T19:45:12Z")

</div>

Good to know, glad it helped!

---

<div class="post-metadata">

**Author:** ![Yosi\_Neuman](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/yosi_neuman/32/9845_2.png) [@Yosi\_Neuman](https://community.dynatrace.com/u/Yosi_Neuman)\
**Post date:** [May 23, 2022, 8:14am UTC](https://community.dynatrace.com/t/tagging-based-on-services-from-a-web-application/34003/6 "2022-05-23T08:14:50Z")

</div>

Hi&nbsp;[@r\_weber](https://community.dynatrace.com/user/35901),

Get lost a bit on what are the allowed types for&nbsp;toRelationships.calls so my question is if&nbsp;there is a way to tag all services in service flow that are being called from a specific Key User Action?

Thanks in advance for your insight on this

All the best and stay safe

Yos

---

<div class="post-metadata">

**Author:** ![Yosi\_Neuman](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/yosi_neuman/32/9845_2.png) [@Yosi\_Neuman](https://community.dynatrace.com/u/Yosi_Neuman)\
**Post date:** [December 1, 2025, 11:19am UTC](https://community.dynatrace.com/t/tagging-based-on-services-from-a-web-application/34003/7 "2025-12-01T11:19:03Z")

</div>

It took me “some time” to get back to my question and the answer is&nbsp;type(service\_method)/type(application\_method)

But still today its not possible to use them for tagging or for Management Zones&nbsp;:facepalm:

with the follow error message: _entitySelector Entity selector contains type which does not support automatically applied tags_

HTH

Yos
