# Count Consecutive Minutes a Metric Exceeds Threshold Using DQL

**URL:** <https://community.dynatrace.com/t/count-consecutive-minutes-a-metric-exceeds-threshold-using-dql/51731>\
**Category:** DQL\
**Tags:** dql, kafka, dynatrace-managed, anomaly-detection\
**Created:** [May 21, 2025, 1:03pm UTC](https://community.dynatrace.com/t/count-consecutive-minutes-a-metric-exceeds-threshold-using-dql/51731 "2025-05-21T13:03:24Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Omerre](https://avatars.discourse-cdn.com/v4/letter/o/47e85d/32.png) [@Omerre](https://community.dynatrace.com/u/Omerre)\
**Post date:** [May 25, 2025, 6:48am UTC](https://community.dynatrace.com/t/count-consecutive-minutes-a-metric-exceeds-threshold-using-dql/51731/3 "2025-05-25T06:48:06Z")

</div>

Hi yanezza, thank you for your help!  
The thing is a normal behavior in our case always includes periodic spikes. Our concern is when the **duration** of the spikes exceeds some threshold, and not necessarily abnormality with the metric values.

 ![Omerre_0-1748154988516.png](https://global.discourse-cdn.com/dynatrace/original/3X/c/4/c4b3fd09db096db4182e3609ab5dfbc8d9ee60f5.png)

Although your suggestion might help with sending notifications when a real problem will arise, it would still fill our environment with huge number of false problems.

Is there any proper way to handle this with DQL? i.e. instead of getting the resulted metric values by time, we would like to get the resulted&nbsp; **duration** of certain metric values.

---

_[View the full topic](https://community.dynatrace.com/t/count-consecutive-minutes-a-metric-exceeds-threshold-using-dql/51731)._
