<?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 Metrics API to query values in Dynatrace API</title>
    <link>https://community.dynatrace.com/t5/Dynatrace-API/Metrics-API-to-query-values/m-p/270218#M3615</link>
    <description>&lt;P&gt;Hi Dynatrace community,&lt;/P&gt;
&lt;P&gt;As I'm om my mission to get the most out of Dynatrace apps, I'm now also exploring the Dynatrace API.&lt;/P&gt;
&lt;P&gt;My use case is around Kong API Gateway, we have hundreds of services deployed and each month I want a list of not-used services. From Kong all the logs, with meta-data, are sent to Dynatrace. In Dynatrace I use the openPipeline to generate metrics from the logs, for example metric kong.log.status has a dimension service.name.&lt;BR /&gt;The report is scheduled in Gitlab and here I want to query the metrics if a certain service.name datapoint exists in the last month.&lt;/P&gt;
&lt;P&gt;The full query will be api/v2/metrics/query?metricSelector=log.kong.status, is it possible to filter on service.name?&lt;BR /&gt;It's part of the response:&lt;BR /&gt;{&lt;BR /&gt;"dimensions": [&lt;BR /&gt;...,&lt;BR /&gt;"ASW_Europe_MyService",&lt;BR /&gt;...&lt;BR /&gt;],&lt;BR /&gt;"dimensionMap": {&lt;BR /&gt;...,&lt;BR /&gt;"service.name": "ASW_Europe_MyService",&lt;BR /&gt;...&lt;BR /&gt;},&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The response from the default last 2 hours is already 10MB, so querying for the last month and parsing the response should not be the right way&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":rolling_on_the_floor_laughing:"&gt;🤣&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;Also, if someone already managed to query similar metrics using grail for example please share an example, might be an option as well although it's asynchronous versus metrics are synchronous.&lt;/P&gt;</description>
    <pubDate>Tue, 18 Feb 2025 07:15:15 GMT</pubDate>
    <dc:creator>ErwinB</dc:creator>
    <dc:date>2025-02-18T07:15:15Z</dc:date>
    <item>
      <title>Metrics API to query values</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-API/Metrics-API-to-query-values/m-p/270218#M3615</link>
      <description>&lt;P&gt;Hi Dynatrace community,&lt;/P&gt;
&lt;P&gt;As I'm om my mission to get the most out of Dynatrace apps, I'm now also exploring the Dynatrace API.&lt;/P&gt;
&lt;P&gt;My use case is around Kong API Gateway, we have hundreds of services deployed and each month I want a list of not-used services. From Kong all the logs, with meta-data, are sent to Dynatrace. In Dynatrace I use the openPipeline to generate metrics from the logs, for example metric kong.log.status has a dimension service.name.&lt;BR /&gt;The report is scheduled in Gitlab and here I want to query the metrics if a certain service.name datapoint exists in the last month.&lt;/P&gt;
&lt;P&gt;The full query will be api/v2/metrics/query?metricSelector=log.kong.status, is it possible to filter on service.name?&lt;BR /&gt;It's part of the response:&lt;BR /&gt;{&lt;BR /&gt;"dimensions": [&lt;BR /&gt;...,&lt;BR /&gt;"ASW_Europe_MyService",&lt;BR /&gt;...&lt;BR /&gt;],&lt;BR /&gt;"dimensionMap": {&lt;BR /&gt;...,&lt;BR /&gt;"service.name": "ASW_Europe_MyService",&lt;BR /&gt;...&lt;BR /&gt;},&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The response from the default last 2 hours is already 10MB, so querying for the last month and parsing the response should not be the right way&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":rolling_on_the_floor_laughing:"&gt;🤣&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;Also, if someone already managed to query similar metrics using grail for example please share an example, might be an option as well although it's asynchronous versus metrics are synchronous.&lt;/P&gt;</description>
      <pubDate>Tue, 18 Feb 2025 07:15:15 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-API/Metrics-API-to-query-values/m-p/270218#M3615</guid>
      <dc:creator>ErwinB</dc:creator>
      <dc:date>2025-02-18T07:15:15Z</dc:date>
    </item>
    <item>
      <title>Re: Metrics API to query values</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-API/Metrics-API-to-query-values/m-p/270314#M3617</link>
      <description>&lt;P&gt;Found it, this time the answer was actually in the documentation&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":rolling_on_the_floor_laughing:"&gt;🤣&lt;/span&gt;&lt;/P&gt;&lt;P&gt;This does the trick: api/v2/metrics/query?metricSelector=log.kong.status:filter(eq("service.name","ASW_Europe_MyService")):fold(sum)&amp;amp;from=now-1M&lt;/P&gt;</description>
      <pubDate>Tue, 18 Feb 2025 11:18:58 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-API/Metrics-API-to-query-values/m-p/270314#M3617</guid>
      <dc:creator>ErwinB</dc:creator>
      <dc:date>2025-02-18T11:18:58Z</dc:date>
    </item>
  </channel>
</rss>

