<?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: Help me convert span-based P90 downstream duration query to metric-based Timeseries DQL in milliseconds? in Dashboarding</title>
    <link>https://community.dynatrace.com/t5/Dashboarding/Help-me-convert-span-based-P90-downstream-duration-query-to/m-p/301297#M5834</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;The issue is most likely caused by how the metric value is being handled in the timeseries query.&lt;/P&gt;&lt;P&gt;timeseries returns an array of values, so the conversion should be done after reducing the array to a scalar value. I would simplify the query and avoid converting each array element separately.&lt;BR /&gt;&lt;BR /&gt;try domething like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;timeseries {
    duration_p90 = percentile(spans.service_request_durations, 90)
},
by: { otel.scope.name, Service.domain, Service.node }
| filter in(Service.domain, array($Service_Domain))
| filter in(Service.node, array($Service_Node))
| fieldsAdd scope_name = toString(otel.scope.name)
| fieldsAdd duration_p90_ms_value = round(toDouble(arrayAvg(duration_p90)), decimals: 2)
| filter isNotNull(duration_p90_ms_value)
| summarize duration_p90_ms = avg(duration_p90_ms_value), by: { scope_name }
| sort duration_p90_ms desc&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 29 Jun 2026 08:09:33 GMT</pubDate>
    <dc:creator>t_pawlak</dc:creator>
    <dc:date>2026-06-29T08:09:33Z</dc:date>
    <item>
      <title>Help me convert span-based P90 downstream duration query to metric-based Timeseries DQL in milliseconds?</title>
      <link>https://community.dynatrace.com/t5/Dashboarding/Help-me-convert-span-based-P90-downstream-duration-query-to/m-p/301287#M5833</link>
      <description>&lt;P&gt;Hi Team,&lt;/P&gt;
&lt;P&gt;I am trying to convert the following &lt;STRONG&gt;span-based DQL query&lt;/STRONG&gt; into a &lt;STRONG&gt;metric-based Timeseries query&lt;/STRONG&gt; using OpenPipeline metric extraction. The goal is to build a dashboard panel that shows the &lt;STRONG&gt;P90 duration of downstream calls&lt;/STRONG&gt;, grouped by scope name.&lt;/P&gt;
&lt;P&gt;&lt;FONT size="4"&gt;&lt;U&gt;Original span-based query&lt;/U&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;fetch spans
| filter service.name == "Service_Name"
| filter in(Service.domain, array($Service_Domain))
| filter in(Service.node, array($Service_Node))
| fieldsAdd scope_name = toString(otel.scope.name)
| summarize duration_p90 = percentile(duration, 90), by:{scope_name}
| sort duration_p90 desc&lt;/LI-CODE&gt;
&lt;P&gt;This query gives the expected P90 duration values in &lt;STRONG&gt;milliseconds&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P&gt;I have created a custom metric through OpenPipeline:&amp;nbsp;&lt;STRONG&gt;&lt;SPAN&gt;spans.service_request_durations&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;DIV class=""&gt;
&lt;DIV class=""&gt;
&lt;DIV class=""&gt;
&lt;DIV class=""&gt;
&lt;DIV class=""&gt;
&lt;DIV class=""&gt;
&lt;DIV class=""&gt;
&lt;DIV class=""&gt;
&lt;DIV class=""&gt;
&lt;DIV class=""&gt;
&lt;DIV class=""&gt;
&lt;DIV class=""&gt;
&lt;DIV class=""&gt;
&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;I am now trying to replicate the same logic using the metric-based Timeseries query below:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;timeseries duration_p90_ns_series = percentile(
    spans.service_request_durations,
    percentile: 90,
    rollup: avg
  ),
  by: {otel.scope.name, Service.domain, Service.node}
| filter in(Service.domain, array($Service_Domain))
| filter in(Service.node, array($Service_Node))
| fieldsAdd scope_name = toString(otel.scope.name)
| fieldsAdd duration_p90_ms_value = arrayAvg(iCollectArray(toDouble(duration_p90_ns_series[]))) / 1000000.0
| filter isNotNull(duration_p90_ms_value)
| summarize duration_p90_ms = avg(duration_p90_ms_value), by: {scope_name}
| fieldsAdd duration_p90_ms = round(duration_p90_ms, decimals: 2)
| sort duration_p90_ms desc&lt;/LI-CODE&gt;
&lt;DIV class=""&gt;
&lt;DIV class=""&gt;
&lt;DIV class=""&gt;
&lt;DIV class=""&gt;
&lt;DIV class=""&gt;
&lt;DIV class=""&gt;
&lt;DIV class=""&gt;
&lt;DIV class=""&gt;
&lt;DIV class=""&gt;
&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;However, when I run this Timeseries query, the value of duration_p90_ms_value is displayed in &lt;STRONG&gt;ps&lt;/STRONG&gt;, whereas the original fetch spans query shows the duration correctly in &lt;STRONG&gt;ms&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P&gt;Could someone please help me understand the correct way to convert this metric-based Timeseries result into &lt;STRONG&gt;milliseconds&lt;/STRONG&gt;, while keeping the same logic as the original span-based query?&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jun 2026 12:38:11 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dashboarding/Help-me-convert-span-based-P90-downstream-duration-query-to/m-p/301287#M5833</guid>
      <dc:creator>S1012</dc:creator>
      <dc:date>2026-06-30T12:38:11Z</dc:date>
    </item>
    <item>
      <title>Re: Help me convert span-based P90 downstream duration query to metric-based Timeseries DQL in milliseconds?</title>
      <link>https://community.dynatrace.com/t5/Dashboarding/Help-me-convert-span-based-P90-downstream-duration-query-to/m-p/301297#M5834</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;The issue is most likely caused by how the metric value is being handled in the timeseries query.&lt;/P&gt;&lt;P&gt;timeseries returns an array of values, so the conversion should be done after reducing the array to a scalar value. I would simplify the query and avoid converting each array element separately.&lt;BR /&gt;&lt;BR /&gt;try domething like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;timeseries {
    duration_p90 = percentile(spans.service_request_durations, 90)
},
by: { otel.scope.name, Service.domain, Service.node }
| filter in(Service.domain, array($Service_Domain))
| filter in(Service.node, array($Service_Node))
| fieldsAdd scope_name = toString(otel.scope.name)
| fieldsAdd duration_p90_ms_value = round(toDouble(arrayAvg(duration_p90)), decimals: 2)
| filter isNotNull(duration_p90_ms_value)
| summarize duration_p90_ms = avg(duration_p90_ms_value), by: { scope_name }
| sort duration_p90_ms desc&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Jun 2026 08:09:33 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dashboarding/Help-me-convert-span-based-P90-downstream-duration-query-to/m-p/301297#M5834</guid>
      <dc:creator>t_pawlak</dc:creator>
      <dc:date>2026-06-29T08:09:33Z</dc:date>
    </item>
    <item>
      <title>Re: Help me convert span-based P90 downstream duration query to metric-based Timeseries DQL in milliseconds?</title>
      <link>https://community.dynatrace.com/t5/Dashboarding/Help-me-convert-span-based-P90-downstream-duration-query-to/m-p/301304#M5835</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/42367"&gt;@t_pawlak&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;I am getting No records and a warning as below.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="S1012_0-1782723477624.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/33552i54356267BE2DD29D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="S1012_0-1782723477624.png" alt="S1012_0-1782723477624.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;timeseries percentile function requires a rollup with the given metric key(s). Use the `rollup` parameter to calculate, for example, the 90th percentile of averages.&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Jun 2026 08:58:34 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dashboarding/Help-me-convert-span-based-P90-downstream-duration-query-to/m-p/301304#M5835</guid>
      <dc:creator>S1012</dc:creator>
      <dc:date>2026-06-29T08:58:34Z</dc:date>
    </item>
    <item>
      <title>Re: Help me convert span-based P90 downstream duration query to metric-based Timeseries DQL in milliseconds?</title>
      <link>https://community.dynatrace.com/t5/Dashboarding/Help-me-convert-span-based-P90-downstream-duration-query-to/m-p/301315#M5837</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;timeseries {
  duration_p90 = percentile(
    spans.service_request_durations,
    percentile: 90,
    rollup: avg
  )
},
by: { otel.scope.name, Service.domain, Service.node }
| filter in(Service.domain, array("aaa"))
| filter in(Service.node, array("aaa"))
| fieldsAdd scope_name = toString(otel.scope.name)
| fieldsAdd duration_p90_ms_value = arrayAvg(duration_p90)
| filter isNotNull(duration_p90_ms_value)
| summarize duration_p90_ms = avg(duration_p90_ms_value), by: { scope_name }
| fieldsAdd duration_p90_ms = round(toDouble(duration_p90_ms), decimals: 2)
| sort duration_p90_ms desc&lt;/LI-CODE&gt;&lt;P&gt;The warning is expected because percentile() on a metric requires a rollup parameter.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Jun 2026 12:32:07 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dashboarding/Help-me-convert-span-based-P90-downstream-duration-query-to/m-p/301315#M5837</guid>
      <dc:creator>t_pawlak</dc:creator>
      <dc:date>2026-06-29T12:32:07Z</dc:date>
    </item>
  </channel>
</rss>

