<?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: grail query container data by namespace in DQL</title>
    <link>https://community.dynatrace.com/t5/DQL/Grail-query-container-data-by-namespace/m-p/211659#M55</link>
    <description>&lt;P&gt;mycontainer in TestNamespaceA&lt;/P&gt;&lt;P&gt;mycontainer in TestNamespaceB&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;each container will have its own usage and limits.&lt;/P&gt;</description>
    <pubDate>Mon, 08 May 2023 21:55:12 GMT</pubDate>
    <dc:creator>Stephen1_Lee</dc:creator>
    <dc:date>2023-05-08T21:55:12Z</dc:date>
    <item>
      <title>Grail query container data by namespace</title>
      <link>https://community.dynatrace.com/t5/DQL/Grail-query-container-data-by-namespace/m-p/211658#M54</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;Can we retrieve the container data by container name and namespace?&lt;/P&gt;
&lt;P&gt;timeseries memory=avg(dt.containers.memory.usage_percent), by:{dt.entity.container_group}&lt;BR /&gt;| filter contains(dt.entity.container_group,"CONTAINER_GROUP-0000339C0F0968B0")&lt;/P&gt;
&lt;P&gt;This works if you know the id of a specific container.&lt;/P&gt;
&lt;P&gt;But we have many containers in different namespaces.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 May 2023 10:17:05 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Grail-query-container-data-by-namespace/m-p/211658#M54</guid>
      <dc:creator>Stephen1_Lee</dc:creator>
      <dc:date>2023-05-30T10:17:05Z</dc:date>
    </item>
    <item>
      <title>Re: grail query container data by namespace</title>
      <link>https://community.dynatrace.com/t5/DQL/Grail-query-container-data-by-namespace/m-p/211659#M55</link>
      <description>&lt;P&gt;mycontainer in TestNamespaceA&lt;/P&gt;&lt;P&gt;mycontainer in TestNamespaceB&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;each container will have its own usage and limits.&lt;/P&gt;</description>
      <pubDate>Mon, 08 May 2023 21:55:12 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Grail-query-container-data-by-namespace/m-p/211659#M55</guid>
      <dc:creator>Stephen1_Lee</dc:creator>
      <dc:date>2023-05-08T21:55:12Z</dc:date>
    </item>
    <item>
      <title>Re: grail query container data by namespace</title>
      <link>https://community.dynatrace.com/t5/DQL/Grail-query-container-data-by-namespace/m-p/211683#M56</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/24856"&gt;@Stephen1_Lee&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;you can join the container group names and instance names and do filtering based on this.&lt;BR /&gt;For example, adding the container group name&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;timeseries memory=avg(dt.containers.memory.usage_percent), by:{dt.entity.container_group}
| lookup [fetch dt.entity.container_group], sourceField:dt.entity.container_group, lookupField:id&lt;/LI-CODE&gt;
&lt;P&gt;Filtering for container group instances&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;timeseries memory=avg(dt.containers.memory.usage_percent), by:{dt.entity.container_group_instance}
| lookup [fetch dt.entity.container_group_instance], sourceField:dt.entity.container_group_instance, lookupField:id
| filter startsWith(lookup.entity.name, "redhat") // your container group instance name&lt;/LI-CODE&gt;
&lt;P&gt;&lt;BR /&gt;Kind regards,&amp;nbsp;&lt;BR /&gt;Philipp&lt;/P&gt;</description>
      <pubDate>Tue, 09 May 2023 07:30:25 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Grail-query-container-data-by-namespace/m-p/211683#M56</guid>
      <dc:creator>Philipp_Kastner</dc:creator>
      <dc:date>2023-05-09T07:30:25Z</dc:date>
    </item>
    <item>
      <title>Re: grail query container data by namespace</title>
      <link>https://community.dynatrace.com/t5/DQL/Grail-query-container-data-by-namespace/m-p/211725#M57</link>
      <description>&lt;P&gt;Hi Philipp&lt;/P&gt;&lt;P&gt;Thanks for your answer.&lt;/P&gt;&lt;P&gt;Unfortuately we have many containers in different namespaces with the same name.&lt;/P&gt;&lt;P&gt;So running the query above gave me a large set of results which I know did not come from 1 namespace.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ie - 1 container -&amp;nbsp;lookup.entity.name": "channels-ms-auth-5-2zqkl channels-ms-auth&lt;/P&gt;&lt;P&gt;another container&amp;nbsp; -&amp;nbsp;lookup.entity.name": "channels-ms-auth-1-vrfr7 channels-ms-auth&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know these are actually 2 different deployments running in separate namespaces.&lt;/P&gt;&lt;P&gt;Is there any way to associate the container entity names to the namespaces?&lt;/P&gt;</description>
      <pubDate>Tue, 09 May 2023 12:52:13 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Grail-query-container-data-by-namespace/m-p/211725#M57</guid>
      <dc:creator>Stephen1_Lee</dc:creator>
      <dc:date>2023-05-09T12:52:13Z</dc:date>
    </item>
    <item>
      <title>Re: grail query container data by namespace</title>
      <link>https://community.dynatrace.com/t5/DQL/Grail-query-container-data-by-namespace/m-p/211763#M58</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/24856"&gt;@Stephen1_Lee&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;with following query you can filter the metric by namespace. While the &lt;CODE&gt;lookup&lt;/CODE&gt; command is already a first step to get more information to timeseries queries (e.g. the entity name as suggested by Philip), you additionally need to follow entity relationships to be able to filter by namespace name:&lt;/P&gt;
&lt;PRE&gt;timeseries memory = avg(dt.containers.memory.usage_percent), by:{dt.entity.container_group}&lt;BR /&gt;| lookup [&lt;BR /&gt;  // get the namespace for container groups by traversing the entity relationships&lt;BR /&gt;  fetch dt.entity.container_group_instance&lt;BR /&gt;  | fieldsAdd instanceOfContainerGroup = instance_of[dt.entity.container_group], belongsToNamespace = belongs_to[dt.entity.cloud_application_namespace]&lt;BR /&gt;  | lookup [fetch dt.entity.container_group], sourceField:instanceOfContainerGroup, lookupField:id, prefix:"container_group."&lt;BR /&gt;  | lookup [fetch dt.entity.cloud_application_namespace], sourceField:belongsToNamespace, lookupField:id, prefix:"namespace."&lt;BR /&gt;  ], sourceField:dt.entity.container_group, lookupField:container_group.id&lt;BR /&gt;| filter lookup.namespace.entity.name == "hipster-shop"&lt;BR /&gt;| fieldsRemove "lookup.*" // remove all lookup fields to have simpler series labels&lt;/PRE&gt;
&lt;P&gt;There are improvements planned to simplify entity relationships in DQL, e.g. for such a filtering use-case like yours.&lt;/P&gt;
&lt;P&gt;Let me know if that helps!&lt;/P&gt;</description>
      <pubDate>Wed, 10 May 2023 07:38:38 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Grail-query-container-data-by-namespace/m-p/211763#M58</guid>
      <dc:creator>stefan_eggersto</dc:creator>
      <dc:date>2023-05-10T07:38:38Z</dc:date>
    </item>
  </channel>
</rss>

