<?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 Use Rate and Bin Functions in DQL Time-Series Queries in DQL</title>
    <link>https://community.dynatrace.com/t5/DQL/Use-Rate-and-Bin-Functions-in-DQL-Time-Series-Queries/m-p/281787#M2336</link>
    <description>&lt;P&gt;Hello Community,&lt;/P&gt;
&lt;P&gt;I am in the process of understanding the use case of bins and the rate function in the timeseries command.&lt;BR /&gt;I wrote a small script that sends a random whole number as a custom metric into Dynatrace every 30s. Here are a few example metrics I sent:&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Sent: custom.random.whole_number 18 2025-07-17 10:04:25&lt;BR /&gt;Sent: custom.random.whole_number 6 2025-07-17 10:04:55&lt;BR /&gt;Sent: custom.random.whole_number 60 2025-07-17 10:05:25&lt;BR /&gt;Sent: custom.random.whole_number 55 2025-07-17 10:05:56&lt;BR /&gt;Sent: custom.random.whole_number 72 2025-07-17 10:06:26&lt;BR /&gt;Sent: custom.random.whole_number 71 2025-07-17 10:06:56&lt;BR /&gt;Sent: custom.random.whole_number 63 2025-07-17 10:07:26&lt;BR /&gt;Sent: custom.random.whole_number 45 2025-07-17 10:07:56&lt;BR /&gt;...&lt;BR /&gt;...&lt;BR /&gt;etc&lt;/P&gt;
&lt;P&gt;When I plot the data using the DQL: timeseries avg(custom.random.whole_number) for a 10m time interval (i.e., 10:00 AM to 10:10 AM), I can see that Dynatrace by default uses a 1m bin and takes the average value of each 1m interval. Everything looks fine, e.g., I can see 12 ((18+6)/2), 57.5 ((60+55)/2), etc.&lt;/P&gt;
&lt;P&gt;My intention was to show raw data in the graph, so I thought the rate function might help here. I updated it to, avg(custom.random.whole_number, rate:30s)&lt;/P&gt;
&lt;P&gt;I was under the impression that the rate function would override the default 1-minute interval with 30s so that I could see the raw data as a result. But unfortunately, I got different results, which were actually half the values from the previous result, i.e., 6, 28.75, etc. This seems like the raw data is divided into each second and then averaged over 30s.&lt;/P&gt;
&lt;P&gt;For example, does it work like this?&lt;BR /&gt;((18 + 6) / 60) * 30) / 2&lt;BR /&gt;Is that how it works?&lt;/P&gt;
&lt;P&gt;If yes, is there any way to display the raw data in the timeseries?&lt;/P&gt;
&lt;P&gt;Additionally, one more question, if we add the bin function in the DQL like this:&lt;BR /&gt;timeseries avg(custom.random.whole_number), bins:24&lt;BR /&gt;What exactly does this do?&lt;/P&gt;</description>
    <pubDate>Wed, 17 Dec 2025 13:46:37 GMT</pubDate>
    <dc:creator>Akhil-Jayendran</dc:creator>
    <dc:date>2025-12-17T13:46:37Z</dc:date>
    <item>
      <title>Use Rate and Bin Functions in DQL Time-Series Queries</title>
      <link>https://community.dynatrace.com/t5/DQL/Use-Rate-and-Bin-Functions-in-DQL-Time-Series-Queries/m-p/281787#M2336</link>
      <description>&lt;P&gt;Hello Community,&lt;/P&gt;
&lt;P&gt;I am in the process of understanding the use case of bins and the rate function in the timeseries command.&lt;BR /&gt;I wrote a small script that sends a random whole number as a custom metric into Dynatrace every 30s. Here are a few example metrics I sent:&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Sent: custom.random.whole_number 18 2025-07-17 10:04:25&lt;BR /&gt;Sent: custom.random.whole_number 6 2025-07-17 10:04:55&lt;BR /&gt;Sent: custom.random.whole_number 60 2025-07-17 10:05:25&lt;BR /&gt;Sent: custom.random.whole_number 55 2025-07-17 10:05:56&lt;BR /&gt;Sent: custom.random.whole_number 72 2025-07-17 10:06:26&lt;BR /&gt;Sent: custom.random.whole_number 71 2025-07-17 10:06:56&lt;BR /&gt;Sent: custom.random.whole_number 63 2025-07-17 10:07:26&lt;BR /&gt;Sent: custom.random.whole_number 45 2025-07-17 10:07:56&lt;BR /&gt;...&lt;BR /&gt;...&lt;BR /&gt;etc&lt;/P&gt;
&lt;P&gt;When I plot the data using the DQL: timeseries avg(custom.random.whole_number) for a 10m time interval (i.e., 10:00 AM to 10:10 AM), I can see that Dynatrace by default uses a 1m bin and takes the average value of each 1m interval. Everything looks fine, e.g., I can see 12 ((18+6)/2), 57.5 ((60+55)/2), etc.&lt;/P&gt;
&lt;P&gt;My intention was to show raw data in the graph, so I thought the rate function might help here. I updated it to, avg(custom.random.whole_number, rate:30s)&lt;/P&gt;
&lt;P&gt;I was under the impression that the rate function would override the default 1-minute interval with 30s so that I could see the raw data as a result. But unfortunately, I got different results, which were actually half the values from the previous result, i.e., 6, 28.75, etc. This seems like the raw data is divided into each second and then averaged over 30s.&lt;/P&gt;
&lt;P&gt;For example, does it work like this?&lt;BR /&gt;((18 + 6) / 60) * 30) / 2&lt;BR /&gt;Is that how it works?&lt;/P&gt;
&lt;P&gt;If yes, is there any way to display the raw data in the timeseries?&lt;/P&gt;
&lt;P&gt;Additionally, one more question, if we add the bin function in the DQL like this:&lt;BR /&gt;timeseries avg(custom.random.whole_number), bins:24&lt;BR /&gt;What exactly does this do?&lt;/P&gt;</description>
      <pubDate>Wed, 17 Dec 2025 13:46:37 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Use-Rate-and-Bin-Functions-in-DQL-Time-Series-Queries/m-p/281787#M2336</guid>
      <dc:creator>Akhil-Jayendran</dc:creator>
      <dc:date>2025-12-17T13:46:37Z</dc:date>
    </item>
    <item>
      <title>Re: Clarification related to timeseries rate and bin functions</title>
      <link>https://community.dynatrace.com/t5/DQL/Use-Rate-and-Bin-Functions-in-DQL-Time-Series-Queries/m-p/281964#M2347</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;The rate parameter just serves to make an adjustment to the data values in case that's needed, using the below formula:&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;EM&gt;The duration that shall be used to adjust the bin values using the following formula: (binValue / interval) * rate&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;The bins parameter on the other hand will control how many values you get in your series. For instance, if you query over 1 hour and specify 10 bins, you will get the hour divided up into 10 chunks of six minutes each.&lt;/P&gt;&lt;P&gt;As for the raw data points, I believe you may be out of luck because Dynatrace &lt;A href="https://docs.dynatrace.com/docs/manage/data-privacy-and-security/data-privacy/data-retention-periods#metrics-grail" target="_blank"&gt;stores metric data&lt;/A&gt; with 1-minute interval granularity, and you would therefore not be able to go any finer than this, no matter what you have in your DQL.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Jul 2025 19:41:09 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Use-Rate-and-Bin-Functions-in-DQL-Time-Series-Queries/m-p/281964#M2347</guid>
      <dc:creator>marco_irmer</dc:creator>
      <dc:date>2025-07-21T19:41:09Z</dc:date>
    </item>
    <item>
      <title>Re: Clarification related to timeseries rate and bin functions</title>
      <link>https://community.dynatrace.com/t5/DQL/Use-Rate-and-Bin-Functions-in-DQL-Time-Series-Queries/m-p/281980#M2349</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/19769"&gt;@marco_irmer&lt;/a&gt;, Thank you for your clarification&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Jul 2025 23:44:51 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Use-Rate-and-Bin-Functions-in-DQL-Time-Series-Queries/m-p/281980#M2349</guid>
      <dc:creator>Akhil-Jayendran</dc:creator>
      <dc:date>2025-07-21T23:44:51Z</dc:date>
    </item>
  </channel>
</rss>

