# Adding hostname in the metric event description

**URL:** <https://community.dynatrace.com/t/adding-hostname-in-the-metric-event-description/44877>\
**Category:** Alerting\
**Tags:** anomaly-detection\
**Created:** [March 27, 2024, 8:23am UTC](https://community.dynatrace.com/t/adding-hostname-in-the-metric-event-description/44877 "2024-03-27T08:23:19Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![SrikanthSamraj](https://avatars.discourse-cdn.com/v4/letter/s/5daacb/32.png) [@SrikanthSamraj](https://community.dynatrace.com/u/SrikanthSamraj)\
**Post date:** [March 27, 2024, 8:23am UTC](https://community.dynatrace.com/t/adding-hostname-in-the-metric-event-description/44877/1 "2024-03-27T08:23:19Z")

</div>

Hi,

I’m trying to monitor CPU usage of a specific process group using metric event (Query definition type as metric key). What can be done to avail host name in the event template description? At present, problem generated shows “Process group” and “severity” but expecting affected host to be part of this description.

Looking for thoughts since I presume it’s not a straightforward one!

Rgds.

---

<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:** [March 27, 2024, 9:08am UTC](https://community.dynatrace.com/t/adding-hostname-in-the-metric-event-description/44877/2 "2024-03-27T09:08:48Z")

</div>

Please try using this metric selector:

```php
builtin:tech.generic.cpu.usage:filter(in("dt.entity.process_group_instance", entitySelector("type(~"PROCESS_GROUP_INSTANCE~"),entityName.equals(~"YOUR PROCESS~")"))):splitBy("dt.entity.process_group_instance"):parents

```

---

<div class="post-metadata">

**Author:** ![SrikanthSamraj](https://avatars.discourse-cdn.com/v4/letter/s/5daacb/32.png) [@SrikanthSamraj](https://community.dynatrace.com/u/SrikanthSamraj)\
**Post date:** [March 27, 2024, 9:18am UTC](https://community.dynatrace.com/t/adding-hostname-in-the-metric-event-description/44877/3 "2024-03-27T09:18:27Z")

</div>

Thanks&nbsp;[@PacoPorro](https://community.dynatrace.com/user/40713). If I understand correctly, we can’t have “hostname” in the event template description if I intend to use metric key rather than metric selector?

---

<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:** [March 27, 2024, 9:31am UTC](https://community.dynatrace.com/t/adding-hostname-in-the-metric-event-description/44877/4 "2024-03-27T09:31:09Z")

</div>

As you can see in the metric explorer the only available dimension is the process group instance, so you want be able&nbsp; to get it directly.

 ![PacoPorro_0-1711531750012.png](https://global.discourse-cdn.com/dynatrace/original/3X/0/3/033099512a0634b86657c7dd197047d9e79d95a5.png)

You can also create a tag “host” with the host detected name, and add the “tags placeholder” to the event.

---

<div class="post-metadata">

**Author:** ![SrikanthSamraj](https://avatars.discourse-cdn.com/v4/letter/s/5daacb/32.png) [@SrikanthSamraj](https://community.dynatrace.com/u/SrikanthSamraj)\
**Post date:** [March 27, 2024, 9:36am UTC](https://community.dynatrace.com/t/adding-hostname-in-the-metric-event-description/44877/5 "2024-03-27T09:36:41Z")

</div>

I’m using below one now,

_builtin:tech.generic.cpu.usage:filter(and(or(in(“dt.entity.process\_group\_instance”,entitySelector(“type(process\_group\_instance),fromRelationship.isInstanceOf(type(PROCESS\_GROUP),tag(~“XXXXXX~”))”))),or(in(“dt.entity.process\_group\_instance”,entitySelector(“type(process\_group\_instance),fromRelationship.isProcessOf(type(HOST),osType(~“LINUX~”))”))))):splitBy(“dt.entity.process\_group\_instance”):parents_

Like you said it does give hostname, process group and cpu usage in %. Only thing I worry is, dimension limits. We have a large server set ~10K Linux hosts.

---

<div class="post-metadata">

**Author:** ![SrikanthSamraj](https://avatars.discourse-cdn.com/v4/letter/s/5daacb/32.png) [@SrikanthSamraj](https://community.dynatrace.com/u/SrikanthSamraj)\
**Post date:** [March 27, 2024, 9:41am UTC](https://community.dynatrace.com/t/adding-hostname-in-the-metric-event-description/44877/6 "2024-03-27T09:41:52Z")

</div>

This time with usage of above metric explorer, I can get options to populate hostname in the event template description, but as expected trouble is with dimension limits.

 ![SrikanthSamraj_1-1711532441212.png](https://global.discourse-cdn.com/dynatrace/original/2X/4/41844be470c0a59fc3d4b88970f4849d64f6c7ac.png)
