# \[Hack of the week\] expand Metric Event duration simply with rollup

**URL:** <https://community.dynatrace.com/t/hack-of-the-week-expand-metric-event-duration-simply-with-rollup/46814>\
**Category:** Dynatrace Tips\
**Tags:** metric-events, dynatrace-managed, data-explorer, problems-classic, tips-and-tricks\
**Created:** [July 25, 2024, 9:41am UTC](https://community.dynatrace.com/t/hack-of-the-week-expand-metric-event-duration-simply-with-rollup/46814 "2024-07-25T09:41:44Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![uros\_djukic1](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/uros_djukic1/32/37084_2.png) [@uros\_djukic1](https://community.dynatrace.com/u/uros_djukic1)\
**Post date:** [July 25, 2024, 9:41am UTC](https://community.dynatrace.com/t/hack-of-the-week-expand-metric-event-duration-simply-with-rollup/46814/1 "2024-07-25T09:41:44Z")

</div>

This trick is applied using the metric expression (Metrics API - Metrics Selector).  
[Batch/ Job case] :  
To meet a particular need, in particular that of a batch/job which fails randomly and thus generates only one piece of data at a time, we will very quickly be inundated with alerts. Compared to the IA limitation (Sliding window + Dealerting samples), no more than 60min.

**rollup transformation is the solution :**

 ![uros_djukic1_1-1721899982167.png](https://global.discourse-cdn.com/dynatrace/original/3X/5/f/5fdd82a351067789e33e6d53fd5753386233b8c0.png)

Like I said, if you’re only using a single rollup, we’re dealing with limitations, so missing data will end the problem…

**\*\*\* WORKAROUND**  
To answer this we can use the rollup transformation. As illustrated below, we see how to extend the analysis window when we have detected the failed event at least once in the last 24 hours.

The advantage is to therefore avoid the repetition of the known event which will require correction.  
Therefore, reduces the number of problems in the Dynatrace sense and avoids spamming notifications.

 ![uros_djukic1_0-1721899574550.png](https://global.discourse-cdn.com/dynatrace/original/2X/c/ccf8c5f7139850b9e8a1911855628fd73597f38d.png)

Given the 60 minutes limitation on rollup, 24 was set to ensure we cover one time slot per day and is very useful if at least 1 single datapoint is generated (e.g. metric C above = red area).

Metric B = represents the number of times the batch fails (purple points).

_Result of detection:_

 ![uros_djukic1_2-1721900177847.png](https://global.discourse-cdn.com/dynatrace/original/2X/2/2a0dd7600824c9876b69b2328f01337db9240e7d.png)

Thanks

---

<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:** [July 25, 2024, 10:46am UTC](https://community.dynatrace.com/t/hack-of-the-week-expand-metric-event-duration-simply-with-rollup/46814/2 "2024-07-25T10:46:28Z")

</div>

Thank you!&nbsp;:money\_mouth\_face:

---

<div class="post-metadata">

**Author:** ![AntonioSousa](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/antoniosousa/32/50_2.png) [@AntonioSousa](https://community.dynatrace.com/u/AntonioSousa)\
**Post date:** [July 25, 2024, 6:15pm UTC](https://community.dynatrace.com/t/hack-of-the-week-expand-metric-event-duration-simply-with-rollup/46814/3 "2024-07-25T18:15:36Z")

</div>

[@uros\_djukic1](https://community.dynatrace.com/user/26886),

Your multiple rollup is really an interesting hack. Also gave me some ideas, but it seems something like an abuse 😂

Rollup rapidly gets out of control when used with most metrics. You might get affected by throttling quite fast, as I documented in [https://community.dynatrace.com/t5/Alerting/Metric-events-that-sum-values-in-a-certain-time-period/m-p/217633](https://community.dynatrace.com/post/217633) &nbsp;but really would have to test how it goes with your idea …

---

<div class="post-metadata">

**Author:** ![DanielS](https://avatars.discourse-cdn.com/v4/letter/d/3ab097/32.png) [@DanielS](https://community.dynatrace.com/u/DanielS)\
**Post date:** [August 21, 2024, 1:26pm UTC](https://community.dynatrace.com/t/hack-of-the-week-expand-metric-event-duration-simply-with-rollup/46814/4 "2024-08-21T13:26:49Z")

</div>

Good Trick!!! Thanks for share.

---

<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:** [August 21, 2024, 1:57pm UTC](https://community.dynatrace.com/t/hack-of-the-week-expand-metric-event-duration-simply-with-rollup/46814/5 "2024-08-21T13:57:58Z")

</div>

Wait, we can hack the rollup to higher than 1h? Wow, lol!!

That’s awesome!
