<?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 Re: DQL - show detected services number trend in DQL</title>
    <link>https://community.dynatrace.com/t5/DQL/DQL-show-detected-services-number-trend/m-p/264575#M1504</link>
    <description>&lt;P&gt;Brilliant! Thanks a lot, was not aware about start() function.&lt;/P&gt;&lt;P&gt;I adapted it this way:&lt;/P&gt;&lt;P&gt;timeseries {req=sum(dt.service.request.count), timestamp=start()}, by:{dt.entity.service}, from:now()-10d, to:now(), interval:1d&lt;BR /&gt;| fieldsAdd d=record(req=req[], timestamp=timestamp[]) | expand d&lt;BR /&gt;| fieldsAdd value = d[req], ts = d[timestamp]&lt;BR /&gt;| filterOut isNull(value)&lt;BR /&gt;| fields ts, dt.entity.service, value&lt;BR /&gt;| summarize countDistinct(dt.entity.service), by:{ts}&lt;/P&gt;&lt;P&gt;I just a summarize by timestamp instead of making a timeseries. I take advantage of this inquiry to ask when it is more convenient makeTimeseries solution or a summarize?&lt;/P&gt;&lt;P&gt;Thanks!&lt;BR /&gt;Paolo&lt;/P&gt;</description>
    <pubDate>Fri, 06 Dec 2024 11:50:51 GMT</pubDate>
    <dc:creator>paolo_fumanelli</dc:creator>
    <dc:date>2024-12-06T11:50:51Z</dc:date>
    <item>
      <title>DQL - show detected services number trend</title>
      <link>https://community.dynatrace.com/t5/DQL/DQL-show-detected-services-number-trend/m-p/264289#M1500</link>
      <description>&lt;P&gt;Hi, I'm trying to setup a dashboard where I want to show some trends over the time.&lt;/P&gt;&lt;P&gt;To make the simplest possible example, let's assume that I'd like to chart the total number of services detected in my tenant over the time, resulting in one data point for each day.&lt;/P&gt;&lt;P&gt;DQL query is easy:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;fetch dt.entity.service&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Is there a way to tranform it to a timeseries?&lt;BR /&gt;I tried with | makeTimeseries but of course it needs some kinf of Timestamp dimension to be added, and I couldn't find a way.&lt;/P&gt;&lt;P&gt;A second attempt to achieve this result was done by reading from a timeseries that involves service, like&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;timeseries sum(dt.service.request.count), by:{dt.entity.service}, from:now()-10d, to:now(), interval:24h&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;This is producing as output an array of values.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="paolo_fumanelli_0-1733242451123.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/25017iCC94E61324BFA309/image-size/medium?v=v2&amp;amp;px=400" role="button" title="paolo_fumanelli_0-1733242451123.png" alt="paolo_fumanelli_0-1733242451123.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;This could be used if somehow I could expand &lt;STRONG&gt;sum(dt.service.request.count)&lt;/STRONG&gt; and adding its related timestamp, but actually I don't know how to do it.&lt;BR /&gt;I just have the timeframe (-10d to now). I can't expand this to multiple rows, where each one represents one datapoint with a value. If I'd be able to do that, then I could count the number of entries by timestamp to get how many services I had in that timestamp.&lt;/P&gt;&lt;P&gt;Do you have any clue on how I can get this result?&lt;/P&gt;&lt;P&gt;Thanks&lt;BR /&gt;Paolo&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2024 16:18:53 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/DQL-show-detected-services-number-trend/m-p/264289#M1500</guid>
      <dc:creator>paolo_fumanelli</dc:creator>
      <dc:date>2024-12-03T16:18:53Z</dc:date>
    </item>
    <item>
      <title>Re: DQL - show detected services number trend</title>
      <link>https://community.dynatrace.com/t5/DQL/DQL-show-detected-services-number-trend/m-p/264565#M1503</link>
      <description>&lt;P&gt;Yes, second approach is as good start. Here is my query:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;timeseries {req=sum(dt.service.request.count), timestamp=start()}, by:{dt.entity.service}, from:now()-10d, to:now(), interval:24h
| fieldsAdd d=record(req=req[], timestamp=timestamp[])
| expand d 
| filterOut isNull(d[req])
| makeTimeseries service_count=countDistinct(dt.entity.service), interval: 24h, time: d[timestamp]&lt;/LI-CODE&gt;&lt;P&gt;We need to unwrap request count timeseries and in order no too lose information to which information each datapoint belongs we need to user special function &lt;STRONG&gt;&lt;EM&gt;start()&lt;/EM&gt;&lt;/STRONG&gt; and later combine it with each datapoint in a record.&lt;BR /&gt;After expand we need to get read rows where number of request was null - these are days when "service did not exists". Now we can build new timeseries with &lt;EM&gt;&lt;STRONG&gt;makeTimeseries&lt;/STRONG&gt; &lt;/EM&gt;when each datapoint will be count of unique service entity ids.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="krzysztof_hoja_0-1733483635286.png" style="width: 837px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/25068iD087AD68D5830493/image-dimensions/837x343?v=v2" width="837" height="343" role="button" title="krzysztof_hoja_0-1733483635286.png" alt="krzysztof_hoja_0-1733483635286.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Dec 2024 11:14:22 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/DQL-show-detected-services-number-trend/m-p/264565#M1503</guid>
      <dc:creator>krzysztof_hoja</dc:creator>
      <dc:date>2024-12-06T11:14:22Z</dc:date>
    </item>
    <item>
      <title>Re: DQL - show detected services number trend</title>
      <link>https://community.dynatrace.com/t5/DQL/DQL-show-detected-services-number-trend/m-p/264575#M1504</link>
      <description>&lt;P&gt;Brilliant! Thanks a lot, was not aware about start() function.&lt;/P&gt;&lt;P&gt;I adapted it this way:&lt;/P&gt;&lt;P&gt;timeseries {req=sum(dt.service.request.count), timestamp=start()}, by:{dt.entity.service}, from:now()-10d, to:now(), interval:1d&lt;BR /&gt;| fieldsAdd d=record(req=req[], timestamp=timestamp[]) | expand d&lt;BR /&gt;| fieldsAdd value = d[req], ts = d[timestamp]&lt;BR /&gt;| filterOut isNull(value)&lt;BR /&gt;| fields ts, dt.entity.service, value&lt;BR /&gt;| summarize countDistinct(dt.entity.service), by:{ts}&lt;/P&gt;&lt;P&gt;I just a summarize by timestamp instead of making a timeseries. I take advantage of this inquiry to ask when it is more convenient makeTimeseries solution or a summarize?&lt;/P&gt;&lt;P&gt;Thanks!&lt;BR /&gt;Paolo&lt;/P&gt;</description>
      <pubDate>Fri, 06 Dec 2024 11:50:51 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/DQL-show-detected-services-number-trend/m-p/264575#M1504</guid>
      <dc:creator>paolo_fumanelli</dc:creator>
      <dc:date>2024-12-06T11:50:51Z</dc:date>
    </item>
    <item>
      <title>Re: DQL - show detected services number trend</title>
      <link>https://community.dynatrace.com/t5/DQL/DQL-show-detected-services-number-trend/m-p/264589#M1505</link>
      <description>&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;makeTimeseries&lt;/STRONG&gt;&lt;/EM&gt; is a special form of summarize:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;aggregation by time is obligatory: you just specify interval, no need to use of &lt;EM&gt;&lt;STRONG&gt;bin()&lt;/STRONG&gt;&lt;/EM&gt; function&lt;/LI&gt;&lt;LI&gt;result is presented in a form of array where index is proportional to subsequent time bins accompanied by timeframe this array covers and interval single bin represents. In an array it is also easy to spot intervals when nothing happened. Also result set is more condensed this way&lt;/LI&gt;&lt;LI&gt;set of allowed aggregation functions is limited: as intended result is timeseries (metric value over time), it make no point to use aggregation functions returning e.g. arrays (like collect...)&amp;nbsp;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;but general idea of operation is pretty much the same..&lt;/P&gt;</description>
      <pubDate>Fri, 06 Dec 2024 13:30:00 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/DQL-show-detected-services-number-trend/m-p/264589#M1505</guid>
      <dc:creator>krzysztof_hoja</dc:creator>
      <dc:date>2024-12-06T13:30:00Z</dc:date>
    </item>
    <item>
      <title>Re: DQL - show detected services number trend</title>
      <link>https://community.dynatrace.com/t5/DQL/DQL-show-detected-services-number-trend/m-p/264600#M1506</link>
      <description>&lt;P&gt;Clear and very useful, thanks again! Paolo&lt;/P&gt;</description>
      <pubDate>Fri, 06 Dec 2024 13:58:52 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/DQL-show-detected-services-number-trend/m-p/264600#M1506</guid>
      <dc:creator>paolo_fumanelli</dc:creator>
      <dc:date>2024-12-06T13:58:52Z</dc:date>
    </item>
  </channel>
</rss>

