<?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: Service Failure rate by host in DQL</title>
    <link>https://community.dynatrace.com/t5/DQL/Service-Failure-rate-by-host/m-p/297898#M3289</link>
    <description>&lt;P&gt;Perfect, Thank you for your help on this. Much appreciated.&amp;nbsp; Will you be able to show me how to do this via openpipeline please?&lt;/P&gt;</description>
    <pubDate>Fri, 17 Apr 2026 09:56:50 GMT</pubDate>
    <dc:creator>jmistry</dc:creator>
    <dc:date>2026-04-17T09:56:50Z</dc:date>
    <item>
      <title>Service Failure rate by host</title>
      <link>https://community.dynatrace.com/t5/DQL/Service-Failure-rate-by-host/m-p/297853#M3279</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;Is there a way where i can see service failure rate but have it split by host.&amp;nbsp;&lt;BR /&gt;we have the same services on multi different host and want to see all services on all host and their failure rate?&lt;/P&gt;
&lt;P&gt;Maybe a DQL query?&lt;/P&gt;
&lt;P&gt;for example:&lt;/P&gt;
&lt;TABLE border="1" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%" height="30px"&gt;Host&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="30px"&gt;Service&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="30px"&gt;Failure Rate&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%" height="30px"&gt;Server111&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="30px"&gt;Service111&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="30px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%" height="30px"&gt;Server111&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="30px"&gt;Service222&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="30px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%" height="30px"&gt;Server222&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="30px"&gt;Service111&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="30px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%" height="30px"&gt;Server222&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="30px"&gt;Service222&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="30px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;</description>
      <pubDate>Fri, 17 Apr 2026 06:35:56 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Service-Failure-rate-by-host/m-p/297853#M3279</guid>
      <dc:creator>jmistry</dc:creator>
      <dc:date>2026-04-17T06:35:56Z</dc:date>
    </item>
    <item>
      <title>Re: Service Failure rate by host</title>
      <link>https://community.dynatrace.com/t5/DQL/Service-Failure-rate-by-host/m-p/297857#M3280</link>
      <description>&lt;P&gt;You can see that directly in the services app in Failures tab.&amp;nbsp; &lt;A href="https://playground.apps.dynatrace.com/ui/apps/dynatrace.services/failure-analysis?tf=2026-04-16T15%3A58%3A03.456Z%3B2026-04-16T16%3A33%3A06.849Z&amp;amp;groupedByColumns=dt.entity.service.entity.name%2Chttp.request.header.host" target="_self"&gt;Playground link .&lt;/A&gt;&lt;/P&gt;&lt;P&gt;You can adjust grouping as necessary. You can also grab SQL from there.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Apr 2026 16:36:33 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Service-Failure-rate-by-host/m-p/297857#M3280</guid>
      <dc:creator>Julius_Loman</dc:creator>
      <dc:date>2026-04-16T16:36:33Z</dc:date>
    </item>
    <item>
      <title>Re: Service Failure rate by host</title>
      <link>https://community.dynatrace.com/t5/DQL/Service-Failure-rate-by-host/m-p/297876#M3281</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;try this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;fetch spans, from:now()-2h, to:now()
| filter request.is_root_span == true
| filter isNotNull(dt.entity.host) and isNotNull(dt.entity.service)
| summarize 
    failed = countIf(request.is_failed == true),
    total = count(),
  by: { dt.entity.host, dt.entity.service }
| fieldsAdd 
    host = entityName(dt.entity.host),
    service = entityName(dt.entity.service),
    failure_rate = 100.0 * failed / if(total == 0, 1, else: total)
| fields host, service, failure_rate
| sort failure_rate desc&lt;/LI-CODE&gt;&lt;P&gt;you should recive this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="host,service,failurate.jpg" style="width: 999px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/32774iA97DEF03BD93BF37/image-size/large?v=v2&amp;amp;px=999" role="button" title="host,service,failurate.jpg" alt="host,service,failurate.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Apr 2026 07:25:59 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Service-Failure-rate-by-host/m-p/297876#M3281</guid>
      <dc:creator>t_pawlak</dc:creator>
      <dc:date>2026-04-17T07:25:59Z</dc:date>
    </item>
    <item>
      <title>Re: Service Failure rate by host</title>
      <link>https://community.dynatrace.com/t5/DQL/Service-Failure-rate-by-host/m-p/297880#M3282</link>
      <description>&lt;P&gt;Ive had a look at this but when i go to find "Host" in Group by it doesnt appear.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Apr 2026 08:09:19 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Service-Failure-rate-by-host/m-p/297880#M3282</guid>
      <dc:creator>jmistry</dc:creator>
      <dc:date>2026-04-17T08:09:19Z</dc:date>
    </item>
    <item>
      <title>Re: Service Failure rate by host</title>
      <link>https://community.dynatrace.com/t5/DQL/Service-Failure-rate-by-host/m-p/297884#M3283</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for this. this has worked but Is there a way you can convert this to timeseries please? i have tried but i get no records coming.&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 17 Apr 2026 08:20:19 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Service-Failure-rate-by-host/m-p/297884#M3283</guid>
      <dc:creator>jmistry</dc:creator>
      <dc:date>2026-04-17T08:20:19Z</dc:date>
    </item>
    <item>
      <title>Re: Service Failure rate by host</title>
      <link>https://community.dynatrace.com/t5/DQL/Service-Failure-rate-by-host/m-p/297889#M3284</link>
      <description>&lt;P&gt;Yes, because your working query starts from fetch spans, you should use makeTimeseries, not timeseries.&lt;BR /&gt;timeseries is the starting command for metrics, while makeTimeseries is the command used after fetching records such as spans. Dynatrace also notes that for spans, makeTimeseries uses the start_time field automatically.&lt;BR /&gt;try this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;fetch spans, from:now()-2h, to:now()
| filter request.is_root_span == true
| filter isNotNull(dt.entity.host) and isNotNull(dt.entity.service)
| makeTimeseries {
    failed = countIf(request.is_failed == true),
    total = count()
  },
  by:{dt.entity.host, dt.entity.service},
  interval: 5m
| fieldsAdd host = entityName(dt.entity.host),
            service = entityName(dt.entity.service),
            failure_rate = if(total[] == 0, 0.0, else: 100.0 * failed[] / total[])
| fields timeframe, interval, host, service, failure_rate&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 17 Apr 2026 09:04:05 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Service-Failure-rate-by-host/m-p/297889#M3284</guid>
      <dc:creator>t_pawlak</dc:creator>
      <dc:date>2026-04-17T09:04:05Z</dc:date>
    </item>
    <item>
      <title>Re: Service Failure rate by host</title>
      <link>https://community.dynatrace.com/t5/DQL/Service-Failure-rate-by-host/m-p/297895#M3286</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for this, this has worked and can put it as a graph. Is there a way we can help reduce the cost for this by doing it a different way as at the minute it is scanning over 100gb and will require it to run quite often?&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I tried this query but it doesnt give me all services on all hosts like yours does.&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;timeseries {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;operand1 = sum(dt.service.request.failure_count),&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;operand2 = sum(dt.service.request.count)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}, by: { dt.entity.service}, nonempty:true&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;| fieldsAdd failureRate_timeseries = operand1[] / operand2[] * 100&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;| fieldsRemove operand1, operand2 | fieldsAdd metricName = "Failure rate"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;| fieldsadd service_name = entityName(dt.entity.service)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;| lookup [fetch dt.entity.host&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;| fields hostid = id, hostname = entity.name, serviceid = runs[dt.entity.service]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;| expand serviceid], lookupField:serviceid, sourceField:dt.entity.service&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;| fieldsRemove dt.entity.service, metricName, lookup.hostid, lookup.serviceid&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Apr 2026 09:51:00 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Service-Failure-rate-by-host/m-p/297895#M3286</guid>
      <dc:creator>jmistry</dc:creator>
      <dc:date>2026-04-17T09:51:00Z</dc:date>
    </item>
    <item>
      <title>Re: Service Failure rate by host</title>
      <link>https://community.dynatrace.com/t5/DQL/Service-Failure-rate-by-host/m-p/297897#M3288</link>
      <description>&lt;P&gt;Hmmmm,&lt;BR /&gt;IMO, the best way to reduce cost is to stop querying raw spans repeatedly and instead extract a metric from spans and query that metric afterward.&lt;BR /&gt;Right now this query works, but it scans a lot of trace data each time. Dynatrace’s own direction is that for this kind of use case, you should use OpenPipeline metric extraction from spans. That gives you a metric you can later query with cheap timeseries instead of repeatedly scanning large amounts of span data.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Apr 2026 09:50:50 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Service-Failure-rate-by-host/m-p/297897#M3288</guid>
      <dc:creator>t_pawlak</dc:creator>
      <dc:date>2026-04-17T09:50:50Z</dc:date>
    </item>
    <item>
      <title>Re: Service Failure rate by host</title>
      <link>https://community.dynatrace.com/t5/DQL/Service-Failure-rate-by-host/m-p/297898#M3289</link>
      <description>&lt;P&gt;Perfect, Thank you for your help on this. Much appreciated.&amp;nbsp; Will you be able to show me how to do this via openpipeline please?&lt;/P&gt;</description>
      <pubDate>Fri, 17 Apr 2026 09:56:50 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Service-Failure-rate-by-host/m-p/297898#M3289</guid>
      <dc:creator>jmistry</dc:creator>
      <dc:date>2026-04-17T09:56:50Z</dc:date>
    </item>
    <item>
      <title>Re: Service Failure rate by host</title>
      <link>https://community.dynatrace.com/t5/DQL/Service-Failure-rate-by-host/m-p/297902#M3290</link>
      <description>&lt;P&gt;try this:&lt;BR /&gt;&lt;A href="https://docs.dynatrace.com/docs/observe/application-observability/services/calculated-service-metric" target="_self"&gt;Calculated metrics for services&lt;/A&gt;&amp;nbsp;&lt;BR /&gt;and&lt;BR /&gt;&lt;A href="https://docs.dynatrace.com/docs/platform/openpipeline/use-cases/tutorial-extract-metrics-from-spans" target="_self"&gt;Extract metrics from spans and distributed traces&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Apr 2026 10:11:36 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Service-Failure-rate-by-host/m-p/297902#M3290</guid>
      <dc:creator>t_pawlak</dc:creator>
      <dc:date>2026-04-17T10:11:36Z</dc:date>
    </item>
    <item>
      <title>Re: Service Failure rate by host</title>
      <link>https://community.dynatrace.com/t5/DQL/Service-Failure-rate-by-host/m-p/297916#M3292</link>
      <description>&lt;P&gt;Thank you for this. appreciate it&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Apr 2026 11:02:53 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Service-Failure-rate-by-host/m-p/297916#M3292</guid>
      <dc:creator>jmistry</dc:creator>
      <dc:date>2026-04-17T11:02:53Z</dc:date>
    </item>
  </channel>
</rss>

