# Tags in metric events

**URL:** <https://community.dynatrace.com/t/tags-in-metric-events/49072>\
**Category:** Alerting\
**Tags:** management-zones, alerting-profile, metric-events, tagging\
**Created:** [November 26, 2024, 4:47pm UTC](https://community.dynatrace.com/t/tags-in-metric-events/49072 "2024-11-26T16:47:32Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![gustavodutra](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/gustavodutra/32/35020_2.png) [@gustavodutra](https://community.dynatrace.com/u/gustavodutra)\
**Post date:** [November 26, 2024, 4:47pm UTC](https://community.dynatrace.com/t/tags-in-metric-events/49072/1 "2024-11-26T16:47:32Z")

</div>

Is it possible to create a tag for metrics events? I created an event based on the metric “builtin:cloud.aws.alb.connections.new,” and it’s working fine. Here is an example image:

 ![gustavodutra_0-1732639505328.png](https://global.discourse-cdn.com/dynatrace/original/3X/a/8/a852122edc8ebce69d77bf78eb76691bebfbccc4.png)

But I need to add a tag to this item so that when I receive an alert, it can be forwarded to ServiceNow to start an incident. However, I am unable to add a tag to this type of event, and I would like to know if there is any way to do this.

My metric event:

builtin:cloud.aws.alb.connections.new:filter(and(or(in(“dt.entity.aws\_application\_load\_balancer”,entitySelector(“type(aws\_application\_load\_balancer),entityName.equals(~“alb-private-\*\*\*\*\*~”)”))))):splitBy():sort(value(auto,descending)):limit(20)

---

<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:** [November 26, 2024, 5:44pm UTC](https://community.dynatrace.com/t/tags-in-metric-events/49072/2 "2024-11-26T17:44:51Z")

</div>

Hi,

Not sure if you can add a tag to a metric event. You can always adding metric event to alerting profile (base on properties, title or another event filter.

Best regards

---

<div class="post-metadata">

**Author:** ![gustavodutra](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/gustavodutra/32/35020_2.png) [@gustavodutra](https://community.dynatrace.com/u/gustavodutra)\
**Post date:** [November 26, 2024, 6:41pm UTC](https://community.dynatrace.com/t/tags-in-metric-events/49072/3 "2024-11-26T18:41:40Z")

</div>

Could you give me an example of how to do this?

---

<div class="post-metadata">

**Author:** ![Venkata\_Sainath\_Ghanachari](https://avatars.discourse-cdn.com/v4/letter/v/3ab097/32.png) [@Venkata\_Sainath\_Ghanachari](https://community.dynatrace.com/u/Venkata_Sainath_Ghanachari)\
**Post date:** [November 27, 2024, 6:32am UTC](https://community.dynatrace.com/t/tags-in-metric-events/49072/4 "2024-11-27T06:32:03Z")

</div>

You can try to add the tags to filter entity, it may use the tags in problem out put.

---

<div class="post-metadata">

**Author:** ![Peter\_Youssef](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/peter_youssef/32/14668_2.png) [@Peter\_Youssef](https://community.dynatrace.com/u/Peter_Youssef)\
**Post date:** [November 27, 2024, 9:05am UTC](https://community.dynatrace.com/t/tags-in-metric-events/49072/5 "2024-11-27T09:05:27Z")

</div>

Hello&nbsp;[@gustavodutra](https://community.dynatrace.com/user/56702)

**PFA Doc URL:**

- [Metric events — Dynatrace Docs](https://docs.dynatrace.com/docs/discover-dynatrace/platform/davis-ai/anomaly-detection/set-up-a-customized-anomaly-detector/how-to-set-up/metric-events)
- [https://docs.dynatrace.com/docs/discover-dynatrace/platform/davis-ai/anomaly-detection/set-up-a-customized-anomaly-detector/how-to-set-up/metric-events/metric-selector-events](https://docs.dynatrace.com/docs/discover-dynatrace/platform/davis-ai/anomaly-detection/set-up-a-customized-anomaly-detector/how-to-set-up/metric-events/metric-selector-events)
- [https://www.youtube.com/watch?v=NVuiTwOYHQA](https://www.youtube.com/watch?v=NVuiTwOYHQA)

Hoping it helps.

BR,

Peter

---

<div class="post-metadata">

**Author:** ![gustavodutra](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/gustavodutra/32/35020_2.png) [@gustavodutra](https://community.dynatrace.com/u/gustavodutra)\
**Post date:** [November 27, 2024, 2:49pm UTC](https://community.dynatrace.com/t/tags-in-metric-events/49072/6 "2024-11-27T14:49:46Z")

</div>

Hi everyone,

I wanted to inform you that I was able to assign a tag to a custom event by following the steps below:

1. Go to **Settings \> Alerting**.
2. Select **Problem alerting profiles**.
3. Choose the desired **alerting profile**.
4. Expand the profile settings.
5. Look for **“Event Filters”**.
6. Click on **Add event filter**.
7. Configure the filter as needed for the alert.

Additionally, I encountered an issue with the metric that was previously configured. It had the following fields:

**Previous Metric Selector:**

```auto
builtin:cloud.aws.alb.connections.new:filter(and(or(in("dt.entity.aws_application_load_balancer",entitySelector("type(aws_application_load_balancer),entityName.equals(~"alb-private- ****** ~")"))))):splitBy():sort(value(auto,descending)):limit(20)

```

The issue was with the use of the splitBy():sort(value(auto,descending)):limit(20) command, which seemed to cause a conflict. After removing it, the alert started working correctly.

**Updated Metric Selector:**

```auto
builtin:cloud.aws.alb.connections.new:filter(and(or(in("dt.entity.aws_application_load_balancer",entitySelector("type(aws_application_load_balancer),entityName.equals(~"alb-private- ****** ~")")))))

```

Now, the configuration is working properly, and alerts are being generated as expected.

If anyone has questions or needs further information, feel free to reach out!

Best regards,  
Gustavo

---

<div class="post-metadata">

**Author:** ![Peter\_Youssef](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/peter_youssef/32/14668_2.png) [@Peter\_Youssef](https://community.dynatrace.com/u/Peter_Youssef)\
**Post date:** [November 27, 2024, 4:31pm UTC](https://community.dynatrace.com/t/tags-in-metric-events/49072/7 "2024-11-27T16:31:05Z")

</div>

Hi&nbsp;[@gustavodutra](https://community.dynatrace.com/user/56702)

Thanks for the updates and sharing the results.

Good Job.

BR,

Peter
