<?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 Which API?: Info of &amp;quot;CPU Usage&amp;quot; and &amp;quot;MEM Usage&amp;quot; in Dynatrace API</title>
    <link>https://community.dynatrace.com/t5/Dynatrace-API/Which-API-Info-of-quot-CPU-Usage-quot-and-quot-MEM-Usage-quot/m-p/198415#M2143</link>
    <description>&lt;P&gt;We intend to get checklist of hosts with their CPU% and MEM% used info, which should return result to be consistent with dynatrace console &amp;gt; hosts page.&amp;nbsp; We tried&amp;nbsp;&lt;SPAN&gt;api/v1/oneagents and api/v1/entity/infrastructure/hosts, we are unable to find those info&amp;nbsp;CPU% and MEM% and NetworkTraffic.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Which API we can use to get those?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 15 Nov 2022 14:49:27 GMT</pubDate>
    <dc:creator>avrildong</dc:creator>
    <dc:date>2022-11-15T14:49:27Z</dc:date>
    <item>
      <title>Which API?: Info of "CPU Usage" and "MEM Usage"</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-API/Which-API-Info-of-quot-CPU-Usage-quot-and-quot-MEM-Usage-quot/m-p/198415#M2143</link>
      <description>&lt;P&gt;We intend to get checklist of hosts with their CPU% and MEM% used info, which should return result to be consistent with dynatrace console &amp;gt; hosts page.&amp;nbsp; We tried&amp;nbsp;&lt;SPAN&gt;api/v1/oneagents and api/v1/entity/infrastructure/hosts, we are unable to find those info&amp;nbsp;CPU% and MEM% and NetworkTraffic.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Which API we can use to get those?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Nov 2022 14:49:27 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-API/Which-API-Info-of-quot-CPU-Usage-quot-and-quot-MEM-Usage-quot/m-p/198415#M2143</guid>
      <dc:creator>avrildong</dc:creator>
      <dc:date>2022-11-15T14:49:27Z</dc:date>
    </item>
    <item>
      <title>Re: Which API?: Info of "CPU Usage" and "MEM Usage"</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-API/Which-API-Info-of-quot-CPU-Usage-quot-and-quot-MEM-Usage-quot/m-p/198419#M2144</link>
      <description>&lt;P&gt;Hi, you'd better use V2 Metrics API with keys&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;builtin:host.mem.usage&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;builtin:host.cpu.usage&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;You can filter by host name or id (also for multiple hosts)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;api/v2/metrics/query?metricSelector=builtin%3Ahost.mem.usage&amp;amp;entitySelector=TYPE%28HOST%29%2CentityId%28XYZ123%29&lt;/PRE&gt;&lt;P&gt;, for example for HOST XYZ123 as shown above.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Nov 2022 16:04:55 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-API/Which-API-Info-of-quot-CPU-Usage-quot-and-quot-MEM-Usage-quot/m-p/198419#M2144</guid>
      <dc:creator>paolo_fumanelli</dc:creator>
      <dc:date>2022-11-15T16:04:55Z</dc:date>
    </item>
    <item>
      <title>Re: Which API?: Info of "CPU Usage" and "MEM Usage"</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-API/Which-API-Info-of-quot-CPU-Usage-quot-and-quot-MEM-Usage-quot/m-p/198425#M2145</link>
      <description>&lt;P&gt;Additionally, you can pull both metrics in a single call and output the data in CSV format with host name:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/api/v2/metrics/query?metricSelector=builtin%3Ahost.%28cpu%2Cmem%29.usage%3Anames&amp;amp;resolution=10m&amp;amp;from=-5m&amp;amp;to=now&amp;amp;entitySelector=type%28%22HOST%22%29" -H "accept: text/csv; charset=utf-8" -H "Authorization: Api-Token &amp;lt;API-TOKEN&amp;gt;"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The above call uses curl arguments and the following metric selector with a names transformation to add the hostname:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;builtin:host.(cpu,mem).usage:names&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Finally, the "accept" header is set to text/csv to output the metric data in CSV format. &amp;nbsp;The data is returned with all the cpu metrics followed by all the memory metrics. &amp;nbsp;A simple sort in Excel can put them in hostname order.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Nov 2022 17:19:33 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-API/Which-API-Info-of-quot-CPU-Usage-quot-and-quot-MEM-Usage-quot/m-p/198425#M2145</guid>
      <dc:creator>mgome</dc:creator>
      <dc:date>2022-11-15T17:19:33Z</dc:date>
    </item>
    <item>
      <title>Re: Which API?: Info of "CPU Usage" and "MEM Usage"</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-API/Which-API-Info-of-quot-CPU-Usage-quot-and-quot-MEM-Usage-quot/m-p/198748#M2153</link>
      <description>&lt;P&gt;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/8132"&gt;@mgome&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Great thanks for the trick!&lt;/P&gt;&lt;P&gt;FYI:&lt;/P&gt;&lt;P&gt;I like this solution of csv (bundle builtin:host.(cpu,mem).usage:names) and definitely keep as future reference. This case I use json output. I am able to use your approach to get below:&lt;/P&gt;&lt;P&gt;Result from /api/v2/metrics/query?metricSelector=builtin%3Ahost.%28cpu%2Cmem%29.usage%3Anames&amp;amp;resolution=10m&amp;amp;from=-5m&amp;amp;to=now:&lt;/P&gt;&lt;P&gt;#1. For builtin:host.cpu.usage&lt;/P&gt;&lt;P&gt;//&lt;BR /&gt;..."result": [&lt;BR /&gt;{&lt;BR /&gt;"metricId": "builtin:host.cpu.usage:names",&lt;BR /&gt;"dataPointCountRatio": 0.001091,&lt;BR /&gt;"dimensionCountRatio": 0.02182,&lt;BR /&gt;"data": [&lt;BR /&gt;{&lt;BR /&gt;"dimensions": [&lt;BR /&gt;"HostName1",&lt;BR /&gt;"HostID1"&lt;BR /&gt;],&lt;BR /&gt;"dimensionMap": {&lt;BR /&gt;"dt.entity.host.name": "HostName1",&lt;BR /&gt;"dt.entity.host": "HostName1"&lt;BR /&gt;},&lt;BR /&gt;"timestamps": [&lt;BR /&gt;1668807600000,&lt;BR /&gt;1668808200000&lt;BR /&gt;],&lt;BR /&gt;"values": [&lt;BR /&gt;4.4364878336588545,&lt;BR /&gt;4.355010986328125&lt;BR /&gt;]&lt;BR /&gt;},... //&lt;BR /&gt;There are 2 values for this "host" (HostName1)&lt;BR /&gt;"values": [&lt;BR /&gt;4.4364878336588545,&lt;BR /&gt;4.355010986328125&lt;BR /&gt;]&lt;BR /&gt;&lt;BR /&gt;#&lt;BR /&gt;#2. For builtin:host.mem.usage&lt;BR /&gt;//&lt;BR /&gt;{&lt;BR /&gt;"metricId": "builtin:host.mem.usage:names",&lt;BR /&gt;"dataPointCountRatio": 0.001091,&lt;BR /&gt;"dimensionCountRatio": 0.02182,&lt;BR /&gt;"data": [&lt;BR /&gt;{&lt;BR /&gt;"dimensions": [&lt;BR /&gt;"HostName1",&lt;BR /&gt;"HostID1"&lt;BR /&gt;],&lt;BR /&gt;"dimensionMap": {&lt;BR /&gt;"dt.entity.host.name": "HostName1",&lt;BR /&gt;"dt.entity.host": "HostID1"&lt;BR /&gt;},&lt;BR /&gt;"timestamps": [&lt;BR /&gt;1668807600000,&lt;BR /&gt;1668808200000&lt;BR /&gt;],&lt;BR /&gt;"values": [&lt;BR /&gt;23.029056294759116,&lt;BR /&gt;23.92061996459961&lt;BR /&gt;]&lt;BR /&gt;},... //&lt;BR /&gt;There are 2 values for this "host" (HostName1)&lt;BR /&gt;"values": [&lt;BR /&gt;23.029056294759116,&lt;BR /&gt;23.92061996459961&lt;BR /&gt;]&lt;BR /&gt;&lt;BR /&gt;Rgds, Avril&lt;/P&gt;</description>
      <pubDate>Fri, 18 Nov 2022 23:15:06 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-API/Which-API-Info-of-quot-CPU-Usage-quot-and-quot-MEM-Usage-quot/m-p/198748#M2153</guid>
      <dc:creator>avrildong</dc:creator>
      <dc:date>2022-11-18T23:15:06Z</dc:date>
    </item>
    <item>
      <title>Re: Which API?: Info of "CPU Usage" and "MEM Usage"</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-API/Which-API-Info-of-quot-CPU-Usage-quot-and-quot-MEM-Usage-quot/m-p/198749#M2154</link>
      <description>&lt;P&gt;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/8132"&gt;@mgome&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;3 more questions:&lt;/P&gt;&lt;P&gt;Q1. If feasible, any straight curl way to only pick last data-point-value? we intend to only grab latest/now data-point binding CPU, MEM%, total MEM, disk latency and network traffic value, which is same as last 30mins default timeframe shown in console &amp;gt; hosts page.&lt;/P&gt;&lt;P&gt;Q2. From "console &amp;gt; hosts page": there is extra "total MEM " + "Disk latency" + "Network traffic", which metrics is for "Disk latency"?&lt;/P&gt;&lt;P&gt;i.e. please also help to review below use case and confirm "total MEM " + "Network traffic" metrics are correct.&lt;/P&gt;&lt;P&gt;HostName1,&lt;/P&gt;&lt;P&gt;"Memory usage" = 4.46 % of 31.2 GiB (4.46% grabbed from above your providing &lt;SPAN&gt;builtin:host.mem.usage, 31.2GiB total MEM from "builtin:host.mem.total"), "Disk latency"=725 µs (? which one?), "Network traffic"="14.7 kbit/s"(from "builtin:host.net.nic.traffic")&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Q3. Same use case from #2.&lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN&gt;CPU%_MEM%_ByHOSTName: api/v2/metrics/query?metricSelector=builtin%3Ahost.%28cpu%2Cmem%29.usage%3Anames&amp;amp;resolution=10m&amp;amp;from=-10m&amp;amp;to=now&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;MEMTotal_ByHOSTName: api/v2/metrics/query?metricSelector=builtin%3Ahost.%28mem%29.total%3Anames&amp;amp;resolution=10m&amp;amp;from=-10m&amp;amp;to=now&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;NetworkTraffic_ByHOSTName: api/v2/metrics/query?metricSelector=builtin%3Ahost.net.nic.traffic%3Anames&amp;amp;resolution=10m&amp;amp;from=-10m&amp;amp;to=now&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;SPAN&gt;I am able to use your approach to grab those 4 metrics by hostname, via 3 separate API calls, is it feasible to make all 3 into 1 convenient API call? if feasible, what could be the syntax?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks &amp;amp; Rgds, Avril&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Nov 2022 23:17:23 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-API/Which-API-Info-of-quot-CPU-Usage-quot-and-quot-MEM-Usage-quot/m-p/198749#M2154</guid>
      <dc:creator>avrildong</dc:creator>
      <dc:date>2022-11-18T23:17:23Z</dc:date>
    </item>
    <item>
      <title>Re: Which API?: Info of "CPU Usage" and "MEM Usage"</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-API/Which-API-Info-of-quot-CPU-Usage-quot-and-quot-MEM-Usage-quot/m-p/198750#M2155</link>
      <description>&lt;P&gt;@paolo_fumanelli, &lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/8132"&gt;@mgome&lt;/a&gt;, thank you very much! It helps.&lt;/P&gt;</description>
      <pubDate>Fri, 18 Nov 2022 22:29:42 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-API/Which-API-Info-of-quot-CPU-Usage-quot-and-quot-MEM-Usage-quot/m-p/198750#M2155</guid>
      <dc:creator>avrildong</dc:creator>
      <dc:date>2022-11-18T22:29:42Z</dc:date>
    </item>
    <item>
      <title>Re: Which API?: Info of "CPU Usage" and "MEM Usage"</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-API/Which-API-Info-of-quot-CPU-Usage-quot-and-quot-MEM-Usage-quot/m-p/198873#M2159</link>
      <description>&lt;P&gt;Q1) There is a last transformation which returns the last data point of the timeframe searched. I wouldn't suggest using it with a timeframe consisting of "now" because often times the current minute is null until the metric value is received.&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.dynatrace.com/support/help/dynatrace-api/environment-api/metric-v2/metric-selector#last" target="_blank" rel="noopener"&gt;https://www.dynatrace.com/support/help/dynatrace-api/environment-api/metric-v2/metric-selector#last&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Q2) Disk latency is the disk read and write time metrics:&lt;BR /&gt;&lt;SPAN&gt;builtin:host.disk.readTime&lt;BR /&gt;builtin:host.disk.writeTime&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Q3) You can use commas to separate multiple metrics in a single query&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;builtin:host.mem.usage,builtin:host.mem.total,builtin:host.net.nic.traffic&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Nov 2022 17:44:10 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-API/Which-API-Info-of-quot-CPU-Usage-quot-and-quot-MEM-Usage-quot/m-p/198873#M2159</guid>
      <dc:creator>mgome</dc:creator>
      <dc:date>2022-11-21T17:44:10Z</dc:date>
    </item>
    <item>
      <title>Re: Which API?: Info of "CPU Usage" and "MEM Usage"</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-API/Which-API-Info-of-quot-CPU-Usage-quot-and-quot-MEM-Usage-quot/m-p/198883#M2160</link>
      <description>&lt;P&gt;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/8132"&gt;@mgome&lt;/a&gt;&lt;/P&gt;&lt;P&gt;All clear, thank you very much!&lt;/P&gt;</description>
      <pubDate>Mon, 21 Nov 2022 21:33:25 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-API/Which-API-Info-of-quot-CPU-Usage-quot-and-quot-MEM-Usage-quot/m-p/198883#M2160</guid>
      <dc:creator>avrildong</dc:creator>
      <dc:date>2022-11-21T21:33:25Z</dc:date>
    </item>
    <item>
      <title>Re: Which API?: Info of "CPU Usage" and "MEM Usage"</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-API/Which-API-Info-of-quot-CPU-Usage-quot-and-quot-MEM-Usage-quot/m-p/198894#M2161</link>
      <description>&lt;P&gt;You need to apply the names transformation to each metric.&lt;BR /&gt;&lt;BR /&gt;builtin:host.mem.usage:names,builtin:host.mem.total:names,builtin:host.net.nic.traffic:names&lt;/P&gt;</description>
      <pubDate>Mon, 21 Nov 2022 21:35:01 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-API/Which-API-Info-of-quot-CPU-Usage-quot-and-quot-MEM-Usage-quot/m-p/198894#M2161</guid>
      <dc:creator>mgome</dc:creator>
      <dc:date>2022-11-21T21:35:01Z</dc:date>
    </item>
  </channel>
</rss>

