<?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: Need DQL Query to get failure rate by service instance or process group instance in DQL</title>
    <link>https://community.dynatrace.com/t5/DQL/Need-DQL-Query-to-get-failure-rate-by-service-instance-or/m-p/283316#M2419</link>
    <description>&lt;P&gt;This is impossible with the built-in metrics (dt.service.*) , as those are calculated per service.&lt;BR /&gt;&lt;BR /&gt;You can do that either by querying spans (be careful with query costs if it will be on a dashboard). You can use something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;fetch spans
| filter  in(dt.entity.service, classicEntitySelector("type(service),entityName.equals(\"prod-service\")")) and request.is_root_span == true
| summarize { failed=countIf(request.is_failed == true), total=count() }, by:{dt.entity.process_group_instance}
| fieldsAdd failure_rate=toDouble(failed)/toDouble(total)&lt;/LI-CODE&gt;&lt;P&gt;You can see another example&amp;nbsp;&lt;A href="https://docs.dynatrace.com/docs/analyze-explore-automate/metrics/upgrade/calculated-service-metrics-upgrade#expand--example-4-requests-of-a-specific-service-split-by-service-instance--4" target="_blank"&gt;here.&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Or you can create a metric in the OpenPipeline for spans, calculate your custom metric there and then use the metric in the dashboard.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 07 Aug 2025 17:31:27 GMT</pubDate>
    <dc:creator>Julius_Loman</dc:creator>
    <dc:date>2025-08-07T17:31:27Z</dc:date>
    <item>
      <title>Need DQL Query to get failure rate by service instance or process group instance</title>
      <link>https://community.dynatrace.com/t5/DQL/Need-DQL-Query-to-get-failure-rate-by-service-instance-or/m-p/283312#M2417</link>
      <description>&lt;P&gt;Need DQL Query to get failure rate by service instance or process group instance&lt;BR /&gt;&amp;nbsp;I tried below query:&lt;BR /&gt;timeseries { failedRequests = sum(dt.service.request.count, scalar: true, filter: { failed == true }), totalRequests = sum(dt.service.request.count, scalar: true) }&lt;BR /&gt;, by: { dt.entity.service, dt.entity.process_group }&lt;BR /&gt;, filter: { in(dt.entity.service, classicEntitySelector("type(service),entityName.equals(\"prod-service")")) }&lt;BR /&gt;| fieldsAdd rate = failedRequests / totalRequests&lt;BR /&gt;| fieldsAdd serviceName = entityName(dt.entity.service)&lt;BR /&gt;| fieldsRename dt.entity.process_group, ProcessGroup&lt;BR /&gt;| sort rate desc&lt;BR /&gt;| fieldsRemove totalRequests, failedRequests&lt;BR /&gt;| lookup [&lt;BR /&gt;fetch dt.entity.process_group_instance&lt;BR /&gt;| fields entity.name, instance_of[dt.entity.process_group]&lt;BR /&gt;| fieldsRename `instance_of[dt.entity.process_group]`, processGroupName&lt;BR /&gt;], sourceField:ProcessGroup, lookupField:processGroupName&lt;BR /&gt;&lt;BR /&gt;Its returning result only failure rate but not by splitting&amp;nbsp; it with&amp;nbsp;process group instance&lt;BR /&gt;Refer screenshot for reference&lt;/P&gt;</description>
      <pubDate>Thu, 07 Aug 2025 16:33:26 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Need-DQL-Query-to-get-failure-rate-by-service-instance-or/m-p/283312#M2417</guid>
      <dc:creator>Ganeshmete77</dc:creator>
      <dc:date>2025-08-07T16:33:26Z</dc:date>
    </item>
    <item>
      <title>Re: Need DQL Query to get failure rate by service instance or process group instance</title>
      <link>https://community.dynatrace.com/t5/DQL/Need-DQL-Query-to-get-failure-rate-by-service-instance-or/m-p/283314#M2418</link>
      <description>&lt;P&gt;Add the summarize command to the end of your DQL and you may get what you need&lt;/P&gt;&lt;P&gt;|summarize avg(rate), by:{ProcessGroup}&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.dynatrace.com/docs/discover-dynatrace/references/dynatrace-query-language/commands/aggregation-commands#summarize" target="_blank" rel="noopener"&gt;https://docs.dynatrace.com/docs/discover-dynatrace/references/dynatrace-query-language/commands/aggregation-commands#summarize&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;edit: I re-read your post and undestood that you need to see the failure rate per instance, not per group...&lt;/P&gt;&lt;P&gt;In this case, the only option we have is thru MDA, choosing the metric as failure rate and setting the dimmension to service instance... but we can not create a metric with this settings, saddly, only save the MDA config for future and quick reference.&lt;/P&gt;&lt;P&gt;I will keep watching this thread, since I am also interested in this, just in case someone knows a better way to do it.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Aug 2025 17:11:14 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Need-DQL-Query-to-get-failure-rate-by-service-instance-or/m-p/283314#M2418</guid>
      <dc:creator>dannemca</dc:creator>
      <dc:date>2025-08-07T17:11:14Z</dc:date>
    </item>
    <item>
      <title>Re: Need DQL Query to get failure rate by service instance or process group instance</title>
      <link>https://community.dynatrace.com/t5/DQL/Need-DQL-Query-to-get-failure-rate-by-service-instance-or/m-p/283316#M2419</link>
      <description>&lt;P&gt;This is impossible with the built-in metrics (dt.service.*) , as those are calculated per service.&lt;BR /&gt;&lt;BR /&gt;You can do that either by querying spans (be careful with query costs if it will be on a dashboard). You can use something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;fetch spans
| filter  in(dt.entity.service, classicEntitySelector("type(service),entityName.equals(\"prod-service\")")) and request.is_root_span == true
| summarize { failed=countIf(request.is_failed == true), total=count() }, by:{dt.entity.process_group_instance}
| fieldsAdd failure_rate=toDouble(failed)/toDouble(total)&lt;/LI-CODE&gt;&lt;P&gt;You can see another example&amp;nbsp;&lt;A href="https://docs.dynatrace.com/docs/analyze-explore-automate/metrics/upgrade/calculated-service-metrics-upgrade#expand--example-4-requests-of-a-specific-service-split-by-service-instance--4" target="_blank"&gt;here.&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Or you can create a metric in the OpenPipeline for spans, calculate your custom metric there and then use the metric in the dashboard.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Aug 2025 17:31:27 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Need-DQL-Query-to-get-failure-rate-by-service-instance-or/m-p/283316#M2419</guid>
      <dc:creator>Julius_Loman</dc:creator>
      <dc:date>2025-08-07T17:31:27Z</dc:date>
    </item>
    <item>
      <title>Re: Need DQL Query to get failure rate by service instance or process group instance</title>
      <link>https://community.dynatrace.com/t5/DQL/Need-DQL-Query-to-get-failure-rate-by-service-instance-or/m-p/283409#M2421</link>
      <description>&lt;P data-unlink="true"&gt;Thank you&amp;nbsp;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;Julius_Loman&lt;/SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Aug 2025 16:22:47 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Need-DQL-Query-to-get-failure-rate-by-service-instance-or/m-p/283409#M2421</guid>
      <dc:creator>Ganeshmete77</dc:creator>
      <dc:date>2025-08-08T16:22:47Z</dc:date>
    </item>
  </channel>
</rss>

