# Tag by Kubernetes Labels

**URL:** <https://community.dynatrace.com/t/tag-by-kubernetes-labels/43918>\
**Category:** Container platforms\
**Tags:** tagging, kubernetes\
**Created:** [January 31, 2024, 2:19pm UTC](https://community.dynatrace.com/t/tag-by-kubernetes-labels/43918 "2024-01-31T14:19:39Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![wellpplava](https://avatars.discourse-cdn.com/v4/letter/w/d26b3c/32.png) [@wellpplava](https://community.dynatrace.com/u/wellpplava)\
**Post date:** [January 31, 2024, 2:19pm UTC](https://community.dynatrace.com/t/tag-by-kubernetes-labels/43918/1 "2024-01-31T14:19:39Z")

</div>

Hello!

We have the label “squad: squad name”, we need to create alert profiles for each squad.

We tried using the [kubernetes]squad: tag, which although it worked to filter services, did not work in the alert profile.

What would be the best case? Is it possible to create automatic tags based on the label?

---

<div class="post-metadata">

**Author:** ![AntonPineiro](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/antonpineiro/32/49_2.png) [@AntonPineiro](https://community.dynatrace.com/u/AntonPineiro)\
**Post date:** [January 31, 2024, 2:29pm UTC](https://community.dynatrace.com/t/tag-by-kubernetes-labels/43918/2 "2024-01-31T14:29:23Z")

</div>

Hi,

You can link an alerging profile to a management zone, maybe it would be easier.

It means, you can create a management zone base your label tags or adding other rules. And then, linking that management zone to an alerting profile.

Best regards

---

<div class="post-metadata">

**Author:** ![wellpplava](https://avatars.discourse-cdn.com/v4/letter/w/d26b3c/32.png) [@wellpplava](https://community.dynatrace.com/u/wellpplava)\
**Post date:** [January 31, 2024, 2:37pm UTC](https://community.dynatrace.com/t/tag-by-kubernetes-labels/43918/3 "2024-01-31T14:37:55Z")

</div>

So, the best case would be to create an mz for each squad, like this?

 ![wellpplava_0-1706711900836.png](https://global.discourse-cdn.com/dynatrace/original/2X/1/1c1daa390035f8e58a8b0fc0a74004dc3473e2d3.png)

---

<div class="post-metadata">

**Author:** ![wellpplava](https://avatars.discourse-cdn.com/v4/letter/w/d26b3c/32.png) [@wellpplava](https://community.dynatrace.com/u/wellpplava)\
**Post date:** [January 31, 2024, 2:45pm UTC](https://community.dynatrace.com/t/tag-by-kubernetes-labels/43918/4 "2024-01-31T14:45:07Z")

</div>

Isn’t there a placeholder for the tag value to be the label?  
​

---

<div class="post-metadata">

**Author:** ![PacoPorro](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/pacoporro/32/36087_2.png) [@PacoPorro](https://community.dynatrace.com/u/PacoPorro)\
**Post date:** [January 31, 2024, 2:50pm UTC](https://community.dynatrace.com/t/tag-by-kubernetes-labels/43918/5 "2024-01-31T14:50:43Z")

</div>

Can I suggest using Monaco to create the management zones?  
Once you have the proper template, you can easily create a new MZ using the template, with the squad name as a variable.

---

<div class="post-metadata">

**Author:** ![AntonPineiro](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/antonpineiro/32/49_2.png) [@AntonPineiro](https://community.dynatrace.com/u/AntonPineiro)\
**Post date:** [January 31, 2024, 4:12pm UTC](https://community.dynatrace.com/t/tag-by-kubernetes-labels/43918/6 "2024-01-31T16:12:14Z")

</div>

Hi,

You can select your Kubernetes label:

 ![AntonPineiro_0-1706717495527.png](https://global.discourse-cdn.com/dynatrace/original/3X/5/f/5f3a7dc3cd73fc69099a4053f436313bf3dc7e34.png)

As press “preview” button to see entities involved. It is to test if you rule is matching expected entities.

Best regards
