# Send alert if the count of specific metric is above threshold

**URL:** <https://community.dynatrace.com/t/send-alert-if-the-count-of-specific-metric-is-above-threshold/42705>\
**Category:** Alerting\
**Tags:** problem-detection, anomaly-detection, problems-classic\
**Created:** [November 20, 2023, 9:11am UTC](https://community.dynatrace.com/t/send-alert-if-the-count-of-specific-metric-is-above-threshold/42705 "2023-11-20T09:11:12Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Malaik](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/malaik/32/32673_2.png) [@Malaik](https://community.dynatrace.com/u/Malaik)\
**Post date:** [November 20, 2023, 9:11am UTC](https://community.dynatrace.com/t/send-alert-if-the-count-of-specific-metric-is-above-threshold/42705/1 "2023-11-20T09:11:12Z")

</div>

Dear Community,

I want to open discussion,

What is the best way to set a metric event for a pecific service/request:

Example: sent email if the count of the service A is above 500 in the last 1 Hour.

 ![Malaik_0-1700471320474.png](https://global.discourse-cdn.com/dynatrace/original/3X/e/2/e2691545ad4a8095dd687981c01ed95a816e0ad9.png)

---

<div class="post-metadata">

**Author:** ![radek\_jasinski](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/radek_jasinski/32/10432_2.png) [@radek\_jasinski](https://community.dynatrace.com/u/radek_jasinski)\
**Post date:** [November 20, 2023, 9:17am UTC](https://community.dynatrace.com/t/send-alert-if-the-count-of-specific-metric-is-above-threshold/42705/2 "2023-11-20T09:17:07Z")

</div>

In general, it depends very much on the specific environment and the requirements for the metric.

To give two examples:

At one of my clients, when Azure monitoring metrics are exceeded (without OA), SMS messages are sent via Webhook and SMS gateway to the relevant administrators.

In another, when OA usage metrics are exceeded, a ticket is created in Kira and a simple script is run via webhook to clear the RAM.

\*Care must also be taken to ensure that the sliding window is not too short, as any slowdown in data transfer from the OA to the DT server can cause false problems.

---

<div class="post-metadata">

**Author:** ![RazTN7](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/raztn7/32/10208_2.png) [@RazTN7](https://community.dynatrace.com/u/RazTN7)\
**Post date:** [November 20, 2023, 10:12am UTC](https://community.dynatrace.com/t/send-alert-if-the-count-of-specific-metric-is-above-threshold/42705/3 "2023-11-20T10:12:55Z")

</div>

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

Normally I might go with something like this.

set threshold as 500 violate 1 time during the sliding window of 60min (not sure 60 dealerting will help here)

 ![RazTN7X_0-1700474758628.png](https://global.discourse-cdn.com/dynatrace/original/3X/d/8/d84e253c796003fc339c7880bf08c19a823ab509.png)

 ![RazTN7X_2-1700474988401.png](https://global.discourse-cdn.com/dynatrace/original/3X/b/9/b9c7ec6052890edc1a2dfeace8ea600584986de0.png)

 ![RazTN7X_3-1700475261142.png](https://global.discourse-cdn.com/dynatrace/original/3X/5/e/5e2832dc63466f3b07e5bf1c58a61fae859b4e75.png)

Thanks

RN

---

<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:** [November 21, 2023, 1:18pm UTC](https://community.dynatrace.com/t/send-alert-if-the-count-of-specific-metric-is-above-threshold/42705/4 "2023-11-21T13:18:50Z")

</div>

All great replies, and just to echo some of the main points, it really depends on the number of samples in that time frame. So you said 1 hour (60 Mins) so the next question is how many times should this occur in 60 mins that would then trigger you to take action?&nbsp; too low gives you too many alerts, too high gives you to little alerts.

---

<div class="post-metadata">

**Author:** ![Malaik](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/malaik/32/32673_2.png) [@Malaik](https://community.dynatrace.com/u/Malaik)\
**Post date:** [November 22, 2023, 8:41am UTC](https://community.dynatrace.com/t/send-alert-if-the-count-of-specific-metric-is-above-threshold/42705/5 "2023-11-22T08:41:09Z")

</div>

Thanks Chad,

But Im not sure that the suggested solution will work.

What i want is not that this threshold (500) was met 1 time in 60mn but I want the count of that metric in 60mn will not exceed 500.

may but 1 time 200 and second time 400, in that case i should raise alert which will not work with that solution

---

<div class="post-metadata">

**Author:** ![Malaik](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/malaik/32/32673_2.png) [@Malaik](https://community.dynatrace.com/u/Malaik)\
**Post date:** [November 22, 2023, 8:41am UTC](https://community.dynatrace.com/t/send-alert-if-the-count-of-specific-metric-is-above-threshold/42705/6 "2023-11-22T08:41:18Z")

</div>

Thanks,

But Im not sure that the suggested solution will work.

What i want is not that this threshold (500) was met 1 time in 60mn but I want the count of that metric in 60mn will not exceed 500.

may but 1 time 200 and second time 400, in that case i should raise alert which will not work with that solution

---

<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:** [August 13, 2024, 9:58am UTC](https://community.dynatrace.com/t/send-alert-if-the-count-of-specific-metric-is-above-threshold/42705/7 "2024-08-13T09:58:44Z")

</div>

Hi&nbsp;[@Malaik](https://community.dynatrace.com/user/23195)&nbsp;  
Have you managed to solve the problem? It would be great if you shared the solution with the Community users 💡
