# Management zone rule using customPgMetadata

**URL:** <https://community.dynatrace.com/t/management-zone-rule-using-custompgmetadata/43831>\
**Category:** Open Q&A\
**Tags:** management-zones, tagging, process-groups\
**Created:** [January 25, 2024, 1:17pm UTC](https://community.dynatrace.com/t/management-zone-rule-using-custompgmetadata/43831 "2024-01-25T13:17:13Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Olav\_Wollrab](https://avatars.discourse-cdn.com/v4/letter/o/a183cd/32.png) [@Olav\_Wollrab](https://community.dynatrace.com/u/Olav_Wollrab)\
**Post date:** [January 25, 2024, 1:17pm UTC](https://community.dynatrace.com/t/management-zone-rule-using-custompgmetadata/43831/1 "2024-01-25T13:17:13Z")

</div>

Hi,

I added metadata to a process group as recommended in

> **[Application metadata and tagging - Best practices and recommendations for...](https://docs.dynatrace.com/docs/manage/tags-and-metadata/basic-concepts/best-practices-and-recommendations-for-tagging#application-metadata-and-tagging)**
>
> Tagging is a powerful mechanism. However, to reap its benefits, tagging should be used carefully and in a meaningful way. To guide you towards this end, we provide you with specific recommendations and best practices, which are described below. With...

Now I want to make use of it in a management zone rule.

![Olav_Wollrab_0-1706187742304.png](https://global.discourse-cdn.com/dynatrace/original/2X/5/5ac6b53258a297bf2b6bc133da35fe9fb447e279.png)

I fail to do so. I tried:&nbsp;type(process\_group\_instance),customPgMetadata(“Environment=Level\_01”)

Can someone help me with it?

P.S.: my current workaround: I use an automatically applied tag rule to lift the information into a tag which I can use with the management zone rule.

 ![Olav_Wollrab_0-1706189564352.png](https://global.discourse-cdn.com/dynatrace/original/3X/e/b/eb00af6072bb4357c432a0c01a70f2926a80afd5.png)

Regards, Olav

---

<div class="post-metadata">

**Author:** ![ChadTurner](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/chadturner/32/161_2.png) [@ChadTurner](https://community.dynatrace.com/u/ChadTurner)\
**Post date:** [January 25, 2024, 1:43pm UTC](https://community.dynatrace.com/t/management-zone-rule-using-custompgmetadata/43831/2 "2024-01-25T13:43:52Z")

</div>

I was able to complete this ask. Granted this is set at the host level but can be applied to PG instances via PGs with the following:

 ![ChadTurner_0-1706190165950.png](https://global.discourse-cdn.com/dynatrace/original/2X/d/da9a13dc181b1831205eb96dcbb391c98c83efa1.png)

 ![ChadTurner_1-1706190203200.png](https://global.discourse-cdn.com/dynatrace/original/1X/e4f09618915bee4bcbd12ea428663b0cd5e41e7d.png)

---

<div class="post-metadata">

**Author:** ![Romanenkov\_Al3x](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/romanenkov_al3x/32/36257_2.png) [@Romanenkov\_Al3x](https://community.dynatrace.com/u/Romanenkov_Al3x)\
**Post date:** [January 25, 2024, 2:02pm UTC](https://community.dynatrace.com/t/management-zone-rule-using-custompgmetadata/43831/3 "2024-01-25T14:02:09Z")

</div>

My example rule for autotaging:

| type(process\_group\_instance),processType(“NGINX”),customPgMetadata(“[ENVIRONMENT]DOG:CORGI”) |
| --- |

 ![Romanenkov_Al3x_1-1706191027258.png](https://global.discourse-cdn.com/dynatrace/original/2X/e/e4659a5e022d07d81dd4174ba7a66e5e520a82f8.png)

Result:

 ![Romanenkov_Al3x_3-1706191308519.png](https://global.discourse-cdn.com/dynatrace/original/3X/e/a/ea9ee65f0befcbd5ca694da69a3dbecb4fb0420a.png)

Manifest:

 ![Romanenkov_Al3x_0-1706190918146.png](https://global.discourse-cdn.com/dynatrace/original/3X/c/4/c49bed577bb3fdd48167c393e46a5821461a5059.png)

yaml:

```markup
- name: DT_CUSTOM_PROP
          value: "DOG=CORGI"

```

This is response from API (ENV v2)&nbsp; **/entities/{entityId}**

 ![Romanenkov_Al3x_2-1706191063208.png](https://global.discourse-cdn.com/dynatrace/original/3X/e/d/ed2b377e1628185b748abb6d7598f426a3504ac5.png)

I have to use this API to create right entityselector. It is really helpful. You need to define only EntityID - from browser -PROCESS\_GROUP\_INSTANCE-XXXXXXXXX and you will get all properties in JSON.

Hope&nbsp;this&nbsp;helps&nbsp;and good luck.

Regards,

Alex Romanenkov

---

<div class="post-metadata">

**Author:** ![Mohamed\_Hamdy](https://avatars.discourse-cdn.com/v4/letter/m/7ab992/32.png) [@Mohamed\_Hamdy](https://community.dynatrace.com/u/Mohamed_Hamdy)\
**Post date:** [January 25, 2024, 2:05pm UTC](https://community.dynatrace.com/t/management-zone-rule-using-custompgmetadata/43831/4 "2024-01-25T14:05:49Z")

</div>

Hi&nbsp;[@Olav\_Wollrab](https://community.dynatrace.com/user/59842)&nbsp;,

you can also try the following

type(process\_group\_instance),customPgMetadata([ENVIRONMENT]Level\_01)  
type(process\_group\_instance),customPgMetadata([ENVIRONMENT]Level\_01:QA)

---

<div class="post-metadata">

**Author:** ![Olav\_Wollrab](https://avatars.discourse-cdn.com/v4/letter/o/a183cd/32.png) [@Olav\_Wollrab](https://community.dynatrace.com/u/Olav_Wollrab)\
**Post date:** [January 25, 2024, 3:29pm UTC](https://community.dynatrace.com/t/management-zone-rule-using-custompgmetadata/43831/5 "2024-01-25T15:29:34Z")

</div>

Gentlemen, thanks to all of you for your valuable input.&nbsp;🙂

Regards, Olav
