# count\_over\_time equivalent

**URL:** <https://community.dynatrace.com/t/count-over-time-equivalent/50727>\
**Category:** DQL\
**Tags:** dql, timeseries\
**Created:** [March 14, 2025, 6:35pm UTC](https://community.dynatrace.com/t/count-over-time-equivalent/50727 "2025-03-14T18:35:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![SimGiants92](https://avatars.discourse-cdn.com/v4/letter/s/47e85d/32.png) [@SimGiants92](https://community.dynatrace.com/u/SimGiants92)\
**Post date:** [March 14, 2025, 6:35pm UTC](https://community.dynatrace.com/t/count-over-time-equivalent/50727/1 "2025-03-14T18:35:15Z")

</div>

I have a duration metric that is populated every time a pipeline runs, i would also like to use this metric to see trends on how often the pipeline is run and the outcome. But because this is not very frequent a simple count on the timeseries does not give a very revealing graph. Instead i would need the sum over the time period for each datapoint to get a clearer picture, the equivalent of count\_over\_time in prometheus.  
I see that i can do an array modification with&nbsp;[arrayCumulativeSum](https://docs.dynatrace.com/docs/discover-dynatrace/references/dynatrace-query-language/functions/array-functions#arrayCumulativeSum)&nbsp;or&nbsp;[arrayMovingSum](https://docs.dynatrace.com/docs/discover-dynatrace/references/dynatrace-query-language/functions/array-functions#array-moving-sum)&nbsp;but i would need instead something related to time both options above also always start from a low sum which is not ideal.  
Is there a way to do this?

---

<div class="post-metadata">

**Author:** ![krzysztof\_hoja](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/krzysztof_hoja/32/34625_2.png) [@krzysztof\_hoja](https://community.dynatrace.com/u/krzysztof_hoja)\
**Post date:** [May 20, 2025, 3:02pm UTC](https://community.dynatrace.com/t/count-over-time-equivalent/50727/2 "2025-05-20T15:02:19Z")

</div>

I think this maybe helpful to get data you want to see.

I have metric (response time for service) which behaves quite like in your description: sometimes we have measurement with major break in between.

Query to get the data looks like this:

```markup
timeseries rt = avg(dt.service.request.response_time), filter:dt.entity.service=="SERVICE-4B4EB791A0B161BC"

```

The result looks like (one measurement over 0.8s, several below 50ms)

 ![krzysztof_hoja_1-1747752468025.png](https://global.discourse-cdn.com/dynatrace/original/3X/7/3/7388e7f276fd83c5e9509d2102f73ecfe0b0c5d9.png)

Apart of actual measurement (response time in this case), each timeseries keeps number of measurements/contributions to metric in specific time slot. To get this information use of _ **rollup:total** _ option is needed:

```markup
timeseries inv = sum(dt.service.request.response_time, rollup:total), filter:dt.entity.service=="SERVICE-4B4EB791A0B161BC"

```

 ![krzysztof_hoja_2-1747752596216.png](https://global.discourse-cdn.com/dynatrace/original/3X/b/5/b5aaa6eb215667480bf7247b78434bdad89af00b.png)

Now we can see number of measurements over time. Of course spaces between bars stay away from each other, but timeseries command has _ **interval:** _ option which allows to widen interval according to needs. In my example I widen interval from default 1 minute to 10 minutes:

```markup
timeseries inv = sum(dt.service.request.response_time, rollup:total), filter:dt.entity.service=="SERVICE-4B4EB791A0B161BC", interval:10m

```

Now bars are not longer apart:

 ![krzysztof_hoja_3-1747753115165.png](https://global.discourse-cdn.com/dynatrace/original/2X/8/89be290a69455e9c7dff5146f84af378a723b337.png)

I hope this helps.
