<?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 V2 API Metrics Questions in Dynatrace API</title>
    <link>https://community.dynatrace.com/t5/Dynatrace-API/V2-API-Metrics-Questions/m-p/196725#M2094</link>
    <description>&lt;P&gt;In the Dynatrace V2 Metrics API, I have a few questions:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1) Can I set a time limit up for a DT V2 API query, or do I need to do that programmatically in my scripting? I ask because I would like it to timeout if a query is trying too hard or trying to return too much data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2) Can I limit the amount of data that my API query will pull back? Once in a while, a query will return a huge amount of data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;3) Can I exclude certain data? For instance, when I pull disk data for a server, once in a while, I pull back an entity with thousands of disks from containers. I'd like to try and limit that in the query.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any advice would be greatly appreciated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Lou&lt;/P&gt;</description>
    <pubDate>Wed, 19 Oct 2022 11:06:37 GMT</pubDate>
    <dc:creator>louis_gallo</dc:creator>
    <dc:date>2022-10-19T11:06:37Z</dc:date>
    <item>
      <title>V2 API Metrics Questions</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-API/V2-API-Metrics-Questions/m-p/196725#M2094</link>
      <description>&lt;P&gt;In the Dynatrace V2 Metrics API, I have a few questions:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1) Can I set a time limit up for a DT V2 API query, or do I need to do that programmatically in my scripting? I ask because I would like it to timeout if a query is trying too hard or trying to return too much data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2) Can I limit the amount of data that my API query will pull back? Once in a while, a query will return a huge amount of data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;3) Can I exclude certain data? For instance, when I pull disk data for a server, once in a while, I pull back an entity with thousands of disks from containers. I'd like to try and limit that in the query.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any advice would be greatly appreciated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Lou&lt;/P&gt;</description>
      <pubDate>Wed, 19 Oct 2022 11:06:37 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-API/V2-API-Metrics-Questions/m-p/196725#M2094</guid>
      <dc:creator>louis_gallo</dc:creator>
      <dc:date>2022-10-19T11:06:37Z</dc:date>
    </item>
    <item>
      <title>Re: V2 API Metrics Questions</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-API/V2-API-Metrics-Questions/m-p/196789#M2095</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/34149"&gt;@louis_gallo&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;IMO yes you should be handling timeouts, however the Dynatrace API will response with a 429 code in case it cannot process your request just yet. In that case I usually retry a couple of seconds later until my requests gets processed.&lt;/LI&gt;&lt;LI&gt;Some API Endpoints give you the option to set a &lt;FONT face="courier new,courier"&gt;pageSize&lt;/FONT&gt; in order to limit the amount of data you get back. Other than that you could also set from/to parameters for a shorter timeframe.&lt;/LI&gt;&lt;LI&gt;Again here you will find some endpoints let you specify an &lt;FONT face="courier new,courier"&gt;entitySelector&lt;/FONT&gt; to reduce the scope of your query. For your example I would use the &lt;FONT face="courier new,courier"&gt;entitySelector&lt;/FONT&gt; either directly in the metric query or through the &lt;FONT face="courier new,courier"&gt;entitySelector&lt;/FONT&gt; parameters e.g:&amp;nbsp;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;builtin:host.disk.free:filter(and(or(in("dt.entity.disk",entitySelector("type(disk),entityName.equals(~"/var/vcap/store~")"))))):splitBy("dt.entity.disk")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;Best,&lt;BR /&gt;Mark&lt;/P&gt;</description>
      <pubDate>Wed, 19 Oct 2022 08:47:42 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-API/V2-API-Metrics-Questions/m-p/196789#M2095</guid>
      <dc:creator>mark_bley</dc:creator>
      <dc:date>2022-10-19T08:47:42Z</dc:date>
    </item>
  </channel>
</rss>

