<?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: Metrics API to get container groups in Dynatrace API</title>
    <link>https://community.dynatrace.com/t5/Dynatrace-API/Metrics-API-to-get-container-groups/m-p/208590#M2416</link>
    <description>&lt;P&gt;Yes, you can reference it by using, type("CONTAINER_GROUP_INSTANCE~"),tag("[context]key1:value-1","key2:value-2","value-3")&lt;/P&gt;</description>
    <pubDate>Thu, 30 Mar 2023 11:48:49 GMT</pubDate>
    <dc:creator>DanielS</dc:creator>
    <dc:date>2023-03-30T11:48:49Z</dc:date>
    <item>
      <title>Metrics API to get container groups</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-API/Metrics-API-to-get-container-groups/m-p/208481#M2395</link>
      <description>&lt;P&gt;I am looking to get the CPU and memory from a particular container instance...&lt;/P&gt;&lt;P&gt;I can find the container details using&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;builtin:kubernetes.containers&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;and filter for the one I need&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I ideally want to run&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;builtin:containers.cpu.usageMilliCores but in order to get the right container I need the&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;container_group_instance value&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I am not sure how to find out this information, can anyone assist?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Mar 2023 12:14:24 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-API/Metrics-API-to-get-container-groups/m-p/208481#M2395</guid>
      <dc:creator>stephenje</dc:creator>
      <dc:date>2023-03-29T12:14:24Z</dc:date>
    </item>
    <item>
      <title>Re: Metrics API to get container groups</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-API/Metrics-API-to-get-container-groups/m-p/208502#M2396</link>
      <description>&lt;P&gt;Not sure what you want to get,&amp;nbsp;&lt;SPAN&gt;builtin:containers.cpu.usageMilliCores also accepts container as filter condition. Can you please further explain your need?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;BR&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Mar 2023 13:25:34 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-API/Metrics-API-to-get-container-groups/m-p/208502#M2396</guid>
      <dc:creator>paolo_fumanelli</dc:creator>
      <dc:date>2023-03-29T13:25:34Z</dc:date>
    </item>
    <item>
      <title>Re: Metrics API to get container groups</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-API/Metrics-API-to-get-container-groups/m-p/208518#M2399</link>
      <description>&lt;P&gt;Hey thanks for the response...... we have multiple containers with the same name as they are in different environments.....&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I am using this query&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;builtin:containers.cpu.usageMilliCores:filter(eq(Container,vehicle-ohs)):names:parents&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;this gives me multiple results....&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;But I only want to use the container returned with this query&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;builtin:kubernetes.containers:filter(eq("k8s.deploymentconfig.name","vehicle-ohs"),eq("k8s.namespace.name","vrm-e2e"),eq("container_state","running")):names:parents&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;But I cannot find out which container group this is i&lt;/SPAN&gt;&lt;SPAN&gt;n?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 29 Mar 2023 14:44:40 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-API/Metrics-API-to-get-container-groups/m-p/208518#M2399</guid>
      <dc:creator>stephenje</dc:creator>
      <dc:date>2023-03-29T14:44:40Z</dc:date>
    </item>
    <item>
      <title>Re: Metrics API to get container groups</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-API/Metrics-API-to-get-container-groups/m-p/208530#M2400</link>
      <description>&lt;P&gt;Hi&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/23732"&gt;@stephenje&lt;/a&gt; you can tag the container on creation to be able to identify it.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Mar 2023 16:45:22 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-API/Metrics-API-to-get-container-groups/m-p/208530#M2400</guid>
      <dc:creator>DanielS</dc:creator>
      <dc:date>2023-03-29T16:45:22Z</dc:date>
    </item>
    <item>
      <title>Re: Metrics API to get container groups</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-API/Metrics-API-to-get-container-groups/m-p/208557#M2404</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/35788"&gt;@DanielS&lt;/a&gt;&amp;nbsp;can those tags be used in a filter?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Mar 2023 06:06:00 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-API/Metrics-API-to-get-container-groups/m-p/208557#M2404</guid>
      <dc:creator>stephenje</dc:creator>
      <dc:date>2023-03-30T06:06:00Z</dc:date>
    </item>
    <item>
      <title>Re: Metrics API to get container groups</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-API/Metrics-API-to-get-container-groups/m-p/208558#M2405</link>
      <description>&lt;P&gt;Hi, if you want to filter only a single container of a specific namespace you can leverage on relationships like this:&lt;/P&gt;&lt;P&gt;builtin:containers.cpu.usageMilliCores&lt;BR /&gt;:filter(in("dt.entity.container_group_instance", entitySelector("type(~"CONTAINER_GROUP_INSTANCE~"),fromRelationships.isCgiOfNamespace(type(CLOUD_APPLICATION_NAMESPACE),entityName.equals(&lt;STRONG&gt;&amp;lt;NAMESPACE_NAME&amp;gt;&lt;/STRONG&gt;))")))&lt;BR /&gt;:splitBy():sort(value(auto,descending)):limit(20)&lt;/P&gt;&lt;P&gt;or by referencing the namespace by id&lt;/P&gt;&lt;P&gt;builtin:containers.cpu.usageMilliCores&lt;BR /&gt;:filter(in("dt.entity.container_group_instance", entitySelector("type(~"CONTAINER_GROUP_INSTANCE~"),fromRelationships.isCgiOfNamespace(type(CLOUD_APPLICATION_NAMESPACE),entityId(&lt;STRONG&gt;&amp;lt;NAMESPACE_entityId&amp;gt;&lt;/STRONG&gt;))")))&lt;BR /&gt;:splitBy():sort(value(auto,descending)):limit(20)&lt;/P&gt;&lt;P&gt;In general usage of relationships when dealing with k8s entities is very useful.&lt;/P&gt;&lt;P&gt;See:&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.dynatrace.com/support/help/dynatrace-api/environment-api/entity-v2/get-all-entity-types" target="_blank"&gt;Monitored entities API - GET all entity types | Dynatrace Docs&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.dynatrace.com/support/help/dynatrace-api/environment-api/entity-v2/entity-selector" target="_blank"&gt;Environment API v2 - Entity selector | Dynatrace Docs&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Hope this helps&lt;/P&gt;&lt;P&gt;Paolo&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Mar 2023 06:41:32 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-API/Metrics-API-to-get-container-groups/m-p/208558#M2405</guid>
      <dc:creator>paolo_fumanelli</dc:creator>
      <dc:date>2023-03-30T06:41:32Z</dc:date>
    </item>
    <item>
      <title>Re: Metrics API to get container groups</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-API/Metrics-API-to-get-container-groups/m-p/208561#M2406</link>
      <description>&lt;P&gt;Awesome thanks&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/19328"&gt;@paolo_fumanelli&lt;/a&gt;&amp;nbsp;that has worked...... mucg appreciated&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Mar 2023 06:57:26 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-API/Metrics-API-to-get-container-groups/m-p/208561#M2406</guid>
      <dc:creator>stephenje</dc:creator>
      <dc:date>2023-03-30T06:57:26Z</dc:date>
    </item>
    <item>
      <title>Re: Metrics API to get container groups</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-API/Metrics-API-to-get-container-groups/m-p/208590#M2416</link>
      <description>&lt;P&gt;Yes, you can reference it by using, type("CONTAINER_GROUP_INSTANCE~"),tag("[context]key1:value-1","key2:value-2","value-3")&lt;/P&gt;</description>
      <pubDate>Thu, 30 Mar 2023 11:48:49 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-API/Metrics-API-to-get-container-groups/m-p/208590#M2416</guid>
      <dc:creator>DanielS</dc:creator>
      <dc:date>2023-03-30T11:48:49Z</dc:date>
    </item>
    <item>
      <title>Re: Metrics API to get container groups</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-API/Metrics-API-to-get-container-groups/m-p/208596#M2417</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/35788"&gt;@DanielS&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Mar 2023 12:21:36 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-API/Metrics-API-to-get-container-groups/m-p/208596#M2417</guid>
      <dc:creator>stephenje</dc:creator>
      <dc:date>2023-03-30T12:21:36Z</dc:date>
    </item>
  </channel>
</rss>

