<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic count_over_time equivalent in DQL</title>
    <link>https://community.dynatrace.com/t5/DQL/count-over-time-equivalent/m-p/272603#M1808</link>
    <description>&lt;P&gt;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.&lt;BR /&gt;I see that i can do an array modification with&amp;nbsp;&lt;A class="" href="https://docs.dynatrace.com/docs/discover-dynatrace/references/dynatrace-query-language/functions/array-functions#arrayCumulativeSum" target="_blank" rel="noopener"&gt;arrayCumulativeSum&lt;/A&gt;&amp;nbsp;or&amp;nbsp;&lt;A class="" href="https://docs.dynatrace.com/docs/discover-dynatrace/references/dynatrace-query-language/functions/array-functions#array-moving-sum" target="_blank" rel="noopener"&gt;arrayMovingSum&lt;/A&gt;&amp;nbsp;but i would need instead something related to time both options above also always start from a low sum which is not ideal.&lt;BR /&gt;Is there a way to do this?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 14 Mar 2025 18:35:15 GMT</pubDate>
    <dc:creator>SimGiants92</dc:creator>
    <dc:date>2025-03-14T18:35:15Z</dc:date>
    <item>
      <title>count_over_time equivalent</title>
      <link>https://community.dynatrace.com/t5/DQL/count-over-time-equivalent/m-p/272603#M1808</link>
      <description>&lt;P&gt;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.&lt;BR /&gt;I see that i can do an array modification with&amp;nbsp;&lt;A class="" href="https://docs.dynatrace.com/docs/discover-dynatrace/references/dynatrace-query-language/functions/array-functions#arrayCumulativeSum" target="_blank" rel="noopener"&gt;arrayCumulativeSum&lt;/A&gt;&amp;nbsp;or&amp;nbsp;&lt;A class="" href="https://docs.dynatrace.com/docs/discover-dynatrace/references/dynatrace-query-language/functions/array-functions#array-moving-sum" target="_blank" rel="noopener"&gt;arrayMovingSum&lt;/A&gt;&amp;nbsp;but i would need instead something related to time both options above also always start from a low sum which is not ideal.&lt;BR /&gt;Is there a way to do this?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Mar 2025 18:35:15 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/count-over-time-equivalent/m-p/272603#M1808</guid>
      <dc:creator>SimGiants92</dc:creator>
      <dc:date>2025-03-14T18:35:15Z</dc:date>
    </item>
    <item>
      <title>Re: count_over_time equivalent</title>
      <link>https://community.dynatrace.com/t5/DQL/count-over-time-equivalent/m-p/277606#M2111</link>
      <description>&lt;P&gt;I think this maybe helpful to get data you want to see.&lt;/P&gt;&lt;P&gt;I have metric (response time for service) which behaves quite like in your description: sometimes we have measurement with major break in between.&lt;/P&gt;&lt;P&gt;Query to get the data looks like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;timeseries rt = avg(dt.service.request.response_time), filter:dt.entity.service=="SERVICE-4B4EB791A0B161BC"&lt;/LI-CODE&gt;&lt;P&gt;The result looks like (one measurement over 0.8s, several below 50ms)&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="krzysztof_hoja_1-1747752468025.png" style="width: 867px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/28092i05C6E2F84FB2B495/image-dimensions/867x170?v=v2" width="867" height="170" role="button" title="krzysztof_hoja_1-1747752468025.png" alt="krzysztof_hoja_1-1747752468025.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;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 &lt;EM&gt;&lt;STRONG&gt;rollup:total&lt;/STRONG&gt;&lt;/EM&gt; option is needed:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;timeseries inv = sum(dt.service.request.response_time, rollup:total), filter:dt.entity.service=="SERVICE-4B4EB791A0B161BC"&lt;/LI-CODE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="krzysztof_hoja_2-1747752596216.png" style="width: 851px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/28093i9234895F4A469A6A/image-dimensions/851x168?v=v2" width="851" height="168" role="button" title="krzysztof_hoja_2-1747752596216.png" alt="krzysztof_hoja_2-1747752596216.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Now we can see number of measurements over time. Of course spaces between bars stay away from each other, but timeseries command has &lt;EM&gt;&lt;STRONG&gt;interval:&lt;/STRONG&gt;&lt;/EM&gt; option which allows to widen interval according to needs. In my example I widen interval from default 1 minute to 10 minutes:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;timeseries inv = sum(dt.service.request.response_time, rollup:total), filter:dt.entity.service=="SERVICE-4B4EB791A0B161BC", interval:10m&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Now bars are not longer apart:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="krzysztof_hoja_3-1747753115165.png" style="width: 849px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/28094i334EC84B1E9F463D/image-dimensions/849x166?v=v2" width="849" height="166" role="button" title="krzysztof_hoja_3-1747753115165.png" alt="krzysztof_hoja_3-1747753115165.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I hope this helps.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 May 2025 15:02:19 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/count-over-time-equivalent/m-p/277606#M2111</guid>
      <dc:creator>krzysztof_hoja</dc:creator>
      <dc:date>2025-05-20T15:02:19Z</dc:date>
    </item>
  </channel>
</rss>

