<?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 Dynatrace V2 Metrics API - Metrics for Only One Tag in Dynatrace API</title>
    <link>https://community.dynatrace.com/t5/Dynatrace-API/Dynatrace-V2-Metrics-API-Metrics-for-Only-One-Tag/m-p/163933#M3516</link>
    <description>&lt;P&gt;Okay, my journey becoming acclimated to the V2 API continues.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How do I limit my entities returned to only one particular application tag? I only want the entities returned in "SomeApplication:SomeApp". The way I am doing it here works but it returns every entity it can find.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P data-unlink="true"&gt;https://xxxxxxxx.live.dynatrace.com/api/v2/metrics/query?metricSelector=builtin:tech.jvm.memory.gc.suspensionTime:names:merge(1)&amp;amp;resolution=1m&amp;amp;from=now-1m&amp;amp;to=now&amp;amp;entityName("SomeApplication:SomeApp")&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any help is appreciated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Lou&lt;/P&gt;</description>
    <pubDate>Fri, 26 Nov 2021 08:27:30 GMT</pubDate>
    <dc:creator>louis_gallo</dc:creator>
    <dc:date>2021-11-26T08:27:30Z</dc:date>
    <item>
      <title>Dynatrace V2 Metrics API - Metrics for Only One Tag</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-API/Dynatrace-V2-Metrics-API-Metrics-for-Only-One-Tag/m-p/163933#M3516</link>
      <description>&lt;P&gt;Okay, my journey becoming acclimated to the V2 API continues.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How do I limit my entities returned to only one particular application tag? I only want the entities returned in "SomeApplication:SomeApp". The way I am doing it here works but it returns every entity it can find.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P data-unlink="true"&gt;https://xxxxxxxx.live.dynatrace.com/api/v2/metrics/query?metricSelector=builtin:tech.jvm.memory.gc.suspensionTime:names:merge(1)&amp;amp;resolution=1m&amp;amp;from=now-1m&amp;amp;to=now&amp;amp;entityName("SomeApplication:SomeApp")&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any help is appreciated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Lou&lt;/P&gt;</description>
      <pubDate>Fri, 26 Nov 2021 08:27:30 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-API/Dynatrace-V2-Metrics-API-Metrics-for-Only-One-Tag/m-p/163933#M3516</guid>
      <dc:creator>louis_gallo</dc:creator>
      <dc:date>2021-11-26T08:27:30Z</dc:date>
    </item>
    <item>
      <title>Re: Dynatrace V2 Metrics API - Metrics for Only One Tag</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-API/Dynatrace-V2-Metrics-API-Metrics-for-Only-One-Tag/m-p/163965#M3517</link>
      <description>&lt;P&gt;Hi Lou,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you have a tag called "SomeApplication" with value "SomeApp" you can add this using the tag entry of the entitySelector parameter.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your query:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;.../metrics/query?metricSelector=builtin:tech.jvm.memory.gc.suspensionTime:names:merge(1)&amp;amp;resolution=1m&amp;amp;from=now-1m&amp;amp;to=now&amp;amp;entityName(%22SomeApplication:SomeApp%22)&lt;/LI-CODE&gt;&lt;P&gt;Is invalid, so I am surprised it works at all. entityName should be part of the entitySelector parameter, but will only work for matching entity names - however, in this case I think it is disregarded completely as it's not part of entitySelector query parameter. Also there is no need to specify "to" when the time is relative as that already implies it's to now.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What you need to use is the&amp;nbsp;&lt;A href="https://www.dynatrace.com/support/help/shortlink/api-metrics-v2-get-datapoints#parameters" target="_self"&gt;entitySelector parameter&lt;/A&gt;&amp;nbsp;with the tag you want to filter by. Among other things, tag is an optional sub-component of it. However, you must also specify either enitity type or ID when using this parameter. For your chosen metric, the entity type is PROCESS_GROUP_INSTANCE (since it's collected per process).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your query would work as such:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;...metrics/query?resolution=1m&amp;amp;entitySelector=type(process_group_instance),tag(SomeApplication:SomeApp)&amp;amp;from=now-1m&amp;amp;metricSelector=builtin:tech.jvm.memory.gc.suspensionTime:names:merge(1)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Give this a try and let us know how it goes.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Radu&lt;/P&gt;</description>
      <pubDate>Thu, 08 Apr 2021 06:42:10 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-API/Dynatrace-V2-Metrics-API-Metrics-for-Only-One-Tag/m-p/163965#M3517</guid>
      <dc:creator>Radu</dc:creator>
      <dc:date>2021-04-08T06:42:10Z</dc:date>
    </item>
    <item>
      <title>Re: Dynatrace V2 Metrics API - Metrics for Only One Tag</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-API/Dynatrace-V2-Metrics-API-Metrics-for-Only-One-Tag/m-p/164008#M3518</link>
      <description>&lt;P&gt;Radu, thanks so much!! That worked great! I just needed the kick start to get the hang of the API.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Apr 2021 13:03:09 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-API/Dynatrace-V2-Metrics-API-Metrics-for-Only-One-Tag/m-p/164008#M3518</guid>
      <dc:creator>louis_gallo</dc:creator>
      <dc:date>2021-04-08T13:03:09Z</dc:date>
    </item>
  </channel>
</rss>

