<?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: Querying services related to an entity in DQL</title>
    <link>https://community.dynatrace.com/t5/DQL/Querying-services-related-to-an-entity/m-p/257465#M1262</link>
    <description>&lt;P&gt;yep, thanks a lot &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; I finally figured it out.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 28 Sep 2024 17:27:56 GMT</pubDate>
    <dc:creator>DamianJankowski</dc:creator>
    <dc:date>2024-09-28T17:27:56Z</dc:date>
    <item>
      <title>Querying services related to an entity</title>
      <link>https://community.dynatrace.com/t5/DQL/Querying-services-related-to-an-entity/m-p/257024#M1236</link>
      <description>&lt;P class=""&gt;I want to create a line chart that displays the response time metric for a selected service. I need it to be dynamic, so I’ve set up a variable. Here’s the variable definition:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;fetch dt.entity.service
| fields entity.name&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;When the user selects an &lt;SPAN class=""&gt;entity.name&lt;/SPAN&gt;, the line chart should update and display the corresponding metric for that service.&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;I’ve tried the following query:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;timeseries response_time = percentile(dt.service.request.response_time, 50),
by: { dt.entity.service },
filter: { in(id, classicEntitySelector("type(service),fromRelationship.IS_SERVICE_OF(type(CLOUD_APPLICATION),entityName.equals($Entity'))")) }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Sep 2024 20:24:33 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Querying-services-related-to-an-entity/m-p/257024#M1236</guid>
      <dc:creator>DamianJankowski</dc:creator>
      <dc:date>2024-09-24T20:24:33Z</dc:date>
    </item>
    <item>
      <title>Re: Querying services related to an entity</title>
      <link>https://community.dynatrace.com/t5/DQL/Querying-services-related-to-an-entity/m-p/257196#M1252</link>
      <description>&lt;P&gt;I see few problem with this query:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;$Entity is string variable, so it should be explicitly concatenated with the rest of entity select expressions&lt;/LI&gt;&lt;LI&gt;If you want to filter by service name (variable values query suggests it), entity selector is incorrect&lt;/LI&gt;&lt;LI&gt;the identification of the service id in metric is&amp;nbsp;dt.entity.service, so it should be used in &lt;EM&gt;&lt;STRONG&gt;in()&lt;/STRONG&gt;&lt;/EM&gt; filtering expression&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;This query should work better:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;timeseries response_time = percentile(dt.service.request.response_time, 50),
by: { dt.entity.service },
filter: { in(dt.entity.service, classicEntitySelector(concat("type(service),entityName.equals(",$Entity,")"))) }&lt;/LI-CODE&gt;&lt;P&gt;Result looks like this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="krzysztof_hoja_0-1727337003922.png" style="width: 852px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/22909iC9E3900BF80F8BFC/image-dimensions/852x281?v=v2" width="852" height="281" role="button" title="krzysztof_hoja_0-1727337003922.png" alt="krzysztof_hoja_0-1727337003922.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>Thu, 26 Sep 2024 07:50:54 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Querying-services-related-to-an-entity/m-p/257196#M1252</guid>
      <dc:creator>krzysztof_hoja</dc:creator>
      <dc:date>2024-09-26T07:50:54Z</dc:date>
    </item>
    <item>
      <title>Re: Querying services related to an entity</title>
      <link>https://community.dynatrace.com/t5/DQL/Querying-services-related-to-an-entity/m-p/257465#M1262</link>
      <description>&lt;P&gt;yep, thanks a lot &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; I finally figured it out.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 28 Sep 2024 17:27:56 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Querying-services-related-to-an-entity/m-p/257465#M1262</guid>
      <dc:creator>DamianJankowski</dc:creator>
      <dc:date>2024-09-28T17:27:56Z</dc:date>
    </item>
  </channel>
</rss>

