# Help needed with Custom Alerting

**URL:** <https://community.dynatrace.com/t/help-needed-with-custom-alerting/47435>\
**Category:** Alerting\
**Tags:** dynatrace-managed, anomaly-detection, problems-classic\
**Created:** [September 2, 2024, 5:03pm UTC](https://community.dynatrace.com/t/help-needed-with-custom-alerting/47435 "2024-09-02T17:03:15Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dannemca](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/dannemca/32/7215_2.png) [@dannemca](https://community.dynatrace.com/u/dannemca)\
**Post date:** [September 2, 2024, 5:03pm UTC](https://community.dynatrace.com/t/help-needed-with-custom-alerting/47435/1 "2024-09-02T17:03:15Z")

</div>

Hi community, good day.

I have a specific need with a custom metric we are ingesting in our Dynatrace env.

To simplify, we are sending traffic data from 4 different hosts, where the host id () and app id are present as metric dimensions. By default, a single app traffic should happen at one host per time.

We now want to alert when an app is generating traffic in more than one host at the same time, for at least 10 min.

I am not finding a way to calculate this, either in DataExplorer (metric expression) nor using Davis Anomaly detection (DQL).

Let’s see if anyone can help me to clear this out.

Example:

 ![image (36).png](https://global.discourse-cdn.com/dynatrace/original/3X/6/5/6513fabe468659806ddf807c820ddb4683fba3e3.png)

That’s a normal behavior, we changed the traffic from one host to another. If the line (traffic) continues for both (or more) hosts at the same time, for 10 min, we have an issue.

Thanks.

---

<div class="post-metadata">

**Author:** ![Gosia\_Murawska](https://avatars.discourse-cdn.com/v4/letter/g/2bfe46/32.png) [@Gosia\_Murawska](https://community.dynatrace.com/u/Gosia_Murawska)\
**Post date:** [December 17, 2024, 10:17am UTC](https://community.dynatrace.com/t/help-needed-with-custom-alerting/47435/2 "2024-12-17T10:17:27Z")

</div>

Hi&nbsp;[@dannemca](https://community.dynatrace.com/user/18264), did you solve this one? 🤔

---

<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:** [December 18, 2024, 11:24am UTC](https://community.dynatrace.com/t/help-needed-with-custom-alerting/47435/3 "2024-12-18T11:24:51Z")

</div>

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

As an applicable suggestion, will divide the solution into “2” tasks as follows:

- **Metric Expression in Data Explorer** : Creating a custom metric expression that combines traffic data and groups by the **app id** and **host id**. Using time window function to check if the app is sending traffic to more than one host at the same time for at least 10 minutes.
- **Dynatrace Query Language** : Defining a custom DQL query to detect anomalies in the metric where traffic occurs across multiple hosts.

Hoping it helps.

BR,

Peter

---

<div class="post-metadata">

**Author:** ![dannemca](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/dannemca/32/7215_2.png) [@dannemca](https://community.dynatrace.com/u/dannemca)\
**Post date:** [January 13, 2025, 8:19pm UTC](https://community.dynatrace.com/t/help-needed-with-custom-alerting/47435/4 "2025-01-13T20:19:00Z")

</div>

Our team managed to “resolve” that creating one metric selector by app and by host grouping… it is not the ideal, since the number of metric selector depends on the number of apps (the more apps, the more metric selectors).  
But at least, we could use the new Davis Anomaly Detector App to create the alerting rules with no limit issues (as we have in metric events settings).

---

<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:** [January 13, 2025, 10:39pm UTC](https://community.dynatrace.com/t/help-needed-with-custom-alerting/47435/5 "2025-01-13T22:39:36Z")

</div>

Thanks&nbsp;[@dannemca](https://community.dynatrace.com/user/18264)&nbsp;for keeping us posted.
