<?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 API to get host mapping in /metrics/query in Dynatrace API</title>
    <link>https://community.dynatrace.com/t5/Dynatrace-API/Dynatrace-API-to-get-host-mapping-in-metrics-query/m-p/186515#M1881</link>
    <description>&lt;P data-unlink="true"&gt;https://xxxxxxxx.live.dynatrace.com/api/v2/metrics/query?metricSelector=builtin:host.mem.avail.pct&amp;amp;resolution=1h&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P data-unlink="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Suppose we use above URL and get sample data&lt;/P&gt;
&lt;P&gt;{&lt;BR /&gt;"totalCount": 2,&lt;BR /&gt;"nextPageKey": null,&lt;BR /&gt;"resolution": "1h",&lt;BR /&gt;"result": [&lt;BR /&gt;{&lt;BR /&gt;"metricId": "builtin:host.mem.avail.pct",&lt;BR /&gt;"data": [&lt;BR /&gt;{&lt;BR /&gt;"dimensions": [&lt;BR /&gt;"HOST-ADBCDAE05CEA42B2"&lt;BR /&gt;],&lt;BR /&gt;"dimensionMap": {&lt;BR /&gt;"dt.entity.host": "HOST-ADBCDAE05CEA42B2"&lt;BR /&gt;},&lt;BR /&gt;"timestamps": [&lt;BR /&gt;1652248800000&lt;BR /&gt;],&lt;BR /&gt;"values": [&lt;BR /&gt;83.1603291829427&lt;BR /&gt;]&lt;BR /&gt;}&lt;BR /&gt;]&lt;BR /&gt;}&lt;BR /&gt;]&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is sample dynatrace response we get. Here we have internal Id's for host.&lt;/P&gt;
&lt;P&gt;Inorder to find actual host name mapping and also process mapping we can use below mentioned APIs seperately.&lt;/P&gt;
&lt;P data-unlink="true"&gt;https://xxxxx.live.dynatrace.com/api/v1/entity/services?relativeTime=5mins&amp;nbsp;&lt;BR /&gt;https://xxxxx.live.dynatrace.com/api/v1/entity/infrastructure/process-groups?relativeTime=5mins&amp;nbsp;&lt;BR /&gt;https://xxxxx.live.dynatrace.com/api/v1/entity/infrastructure/processes?relativeTime=5mins&amp;nbsp;&lt;BR /&gt;https://xxxxx.live.dynatrace.com/api/v1/entity/applications/&amp;nbsp;&lt;BR /&gt;https://xxxxx.live.dynatrace.com/api/v1/entity/infrastructure/hosts&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can we get all metric data along with mapping data in /metrics/query API without calling above 5 apis? If any apis like that please let us know&lt;/P&gt;</description>
    <pubDate>Mon, 16 May 2022 07:48:44 GMT</pubDate>
    <dc:creator>manjunathcr</dc:creator>
    <dc:date>2022-05-16T07:48:44Z</dc:date>
    <item>
      <title>Dynatrace API to get host mapping in /metrics/query</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-API/Dynatrace-API-to-get-host-mapping-in-metrics-query/m-p/186515#M1881</link>
      <description>&lt;P data-unlink="true"&gt;https://xxxxxxxx.live.dynatrace.com/api/v2/metrics/query?metricSelector=builtin:host.mem.avail.pct&amp;amp;resolution=1h&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P data-unlink="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Suppose we use above URL and get sample data&lt;/P&gt;
&lt;P&gt;{&lt;BR /&gt;"totalCount": 2,&lt;BR /&gt;"nextPageKey": null,&lt;BR /&gt;"resolution": "1h",&lt;BR /&gt;"result": [&lt;BR /&gt;{&lt;BR /&gt;"metricId": "builtin:host.mem.avail.pct",&lt;BR /&gt;"data": [&lt;BR /&gt;{&lt;BR /&gt;"dimensions": [&lt;BR /&gt;"HOST-ADBCDAE05CEA42B2"&lt;BR /&gt;],&lt;BR /&gt;"dimensionMap": {&lt;BR /&gt;"dt.entity.host": "HOST-ADBCDAE05CEA42B2"&lt;BR /&gt;},&lt;BR /&gt;"timestamps": [&lt;BR /&gt;1652248800000&lt;BR /&gt;],&lt;BR /&gt;"values": [&lt;BR /&gt;83.1603291829427&lt;BR /&gt;]&lt;BR /&gt;}&lt;BR /&gt;]&lt;BR /&gt;}&lt;BR /&gt;]&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is sample dynatrace response we get. Here we have internal Id's for host.&lt;/P&gt;
&lt;P&gt;Inorder to find actual host name mapping and also process mapping we can use below mentioned APIs seperately.&lt;/P&gt;
&lt;P data-unlink="true"&gt;https://xxxxx.live.dynatrace.com/api/v1/entity/services?relativeTime=5mins&amp;nbsp;&lt;BR /&gt;https://xxxxx.live.dynatrace.com/api/v1/entity/infrastructure/process-groups?relativeTime=5mins&amp;nbsp;&lt;BR /&gt;https://xxxxx.live.dynatrace.com/api/v1/entity/infrastructure/processes?relativeTime=5mins&amp;nbsp;&lt;BR /&gt;https://xxxxx.live.dynatrace.com/api/v1/entity/applications/&amp;nbsp;&lt;BR /&gt;https://xxxxx.live.dynatrace.com/api/v1/entity/infrastructure/hosts&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can we get all metric data along with mapping data in /metrics/query API without calling above 5 apis? If any apis like that please let us know&lt;/P&gt;</description>
      <pubDate>Mon, 16 May 2022 07:48:44 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-API/Dynatrace-API-to-get-host-mapping-in-metrics-query/m-p/186515#M1881</guid>
      <dc:creator>manjunathcr</dc:creator>
      <dc:date>2022-05-16T07:48:44Z</dc:date>
    </item>
    <item>
      <title>Re: Dynatrace API to get host mapping in /metrics/query</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-API/Dynatrace-API-to-get-host-mapping-in-metrics-query/m-p/186686#M1889</link>
      <description>&lt;P&gt;It sounds like you may just need to add the '&lt;A href="https://www.dynatrace.com/support/help/dynatrace-api/environment-api/metric-v2/metric-selector#names" target="_self"&gt;names&lt;/A&gt;' transformation to your metric query e.g.:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;builtin:host.disk.usedPct:splitBy("dt.entity.disk", "dt.entity.host"):names&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This includes the names that map to the ids in the dimension mapping:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JamesKitson_0-1652811511657.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/5720iE16563BCDFC577BC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JamesKitson_0-1652811511657.png" alt="JamesKitson_0-1652811511657.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 May 2022 18:19:16 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-API/Dynatrace-API-to-get-host-mapping-in-metrics-query/m-p/186686#M1889</guid>
      <dc:creator>JamesKitson</dc:creator>
      <dc:date>2022-05-17T18:19:16Z</dc:date>
    </item>
  </channel>
</rss>

