<?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>article Excluded Prometheus metrics are still fetched by ActiveGate in Troubleshooting</title>
    <link>https://community.dynatrace.com/t5/Troubleshooting/Excluded-Prometheus-metrics-are-still-fetched-by-ActiveGate/ta-p/262203</link>
    <description>&lt;P&gt;If you are monitoring Prometheus metrics you may want to exclude some noise metrics or include only selected metrics that provide more business content.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV class="lia-message-template-content-zone"&gt;
&lt;H1 id="toc-hId--705515381"&gt;&lt;STRONG&gt;Symptoms&lt;/STRONG&gt;&lt;/H1&gt;
You have excluded some noise Prometheus metrics from ingestion by using a &lt;A href="https://docs.dynatrace.com/docs/shortlink/monitor-prometheus-metrics#filter-metrics" target="_self"&gt;filtering&lt;/A&gt; option, but on the Dynatrace UI (data explorer) the excluded metrics are still visible and AG continues to fetch them. &lt;BR /&gt;&lt;BR /&gt;&lt;/DIV&gt;
&lt;DIV class="lia-message-template-content-zone"&gt;For example, you have configured the exlusion rule like this&lt;/DIV&gt;
&lt;DIV class="lia-message-template-content-zone"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="lia-message-template-content-zone"&gt;&lt;LI-CODE lang="markup"&gt;      annotations:
        metrics.dynatrace.com/filter: |
          {
              "mode": "exclude",
              "names":
              [
                  "sample_request_client_request_bytes_count",
                  "sample_request_client_request_bytes_max",
                  "sample_request_client_request_bytes_sum",
                  "sample_request_client_response_bytes_count",
                  "sample_request_client_response_bytes_max",
                  "sample_request_client_response_bytes_sum",
                  ...
              ]
          }&lt;/LI-CODE&gt;&lt;/DIV&gt;
&lt;H1&gt;&amp;nbsp;&lt;/H1&gt;
&lt;H1 id="toc-hId--1514862007"&gt;&lt;STRONG&gt;Resolution&lt;/STRONG&gt;&lt;/H1&gt;
&lt;P&gt;Looking at the Prometheus metrics from the exposer instance we get this response&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;...
# TYPE sample_request_client_request_bytes summary
# HELP sample_request_client_request_bytes Size of requests in bytes
sample_request_client_request_bytes_count{method="POST",route="/api/v1/app/versions/validate"} 1480.0
sample_request_client_request_bytes_sum{method="POST",route="/api/v1/app/versions/validate"} 345163.0
sample_request_client_request_bytes_count{method="POST",route="/api/v1/labels/sample/get"} 115.0
sample_request_client_request_bytes_sum{method="POST",route="/api/v1/labels/sample/get"} 28352.0
...&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The excluded metrics&lt;SPAN&gt; have an actual name as defined in the “&lt;CODE class="code css-1tbex3z" data-renderer-mark="true"&gt;# TYPE sample_request_client_request_bytes summary&lt;/CODE&gt;” line in Prometheus (here: &lt;CODE class="code css-1tbex3z" data-renderer-mark="true"&gt;sample_request_client_request_bytes&lt;/CODE&gt;), and may contain additional sum and count datapoints with different metric keys (here: &lt;CODE class="code css-1tbex3z" data-renderer-mark="true"&gt;sample_request_client_request_bytes_sum&lt;/CODE&gt; and &lt;CODE class="code css-1tbex3z" data-renderer-mark="true"&gt;sample_request_client_request_bytes_count&lt;/CODE&gt;).&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;When applying the configured operations, the filter groups all data points within a metric together and does not consider the other metric keys contained within this metric. So, in this case the filter will only evaluate the actual metric &lt;CODE class="code css-1tbex3z" data-renderer-mark="true"&gt;sample_request_client_request_bytes&lt;/CODE&gt; but not the &lt;CODE class="code css-1tbex3z" data-renderer-mark="true"&gt;_sum&lt;/CODE&gt; and &lt;CODE class="code css-1tbex3z" data-renderer-mark="true"&gt;_count&lt;/CODE&gt; data points included inside.&lt;BR /&gt;If &lt;CODE class="code css-1tbex3z" data-renderer-mark="true"&gt;sample_request_client_request_bytes&lt;/CODE&gt; is excluded by the filter, the &lt;CODE class="code css-1tbex3z" data-renderer-mark="true"&gt;_sum&lt;/CODE&gt; and &lt;CODE class="code css-1tbex3z" data-renderer-mark="true"&gt;_count&lt;/CODE&gt; data points will also be excluded.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Example of how the correct filtering should look like:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;metrics.dynatrace.com/filter: |
          {
              "mode": "exclude",
              "names":
              [
                  ...
                  "sample_request_client_request_bytes",
                  ...
             ]
          }&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 12 Nov 2024 14:14:55 GMT</pubDate>
    <dc:creator>shahinm</dc:creator>
    <dc:date>2024-11-12T14:14:55Z</dc:date>
    <item>
      <title>Excluded Prometheus metrics are still fetched by ActiveGate</title>
      <link>https://community.dynatrace.com/t5/Troubleshooting/Excluded-Prometheus-metrics-are-still-fetched-by-ActiveGate/ta-p/262203</link>
      <description>&lt;P&gt;If you are monitoring Prometheus metrics you may want to exclude some noise metrics or include only selected metrics that provide more business content.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV class="lia-message-template-content-zone"&gt;
&lt;H1 id="toc-hId--705515381"&gt;&lt;STRONG&gt;Symptoms&lt;/STRONG&gt;&lt;/H1&gt;
You have excluded some noise Prometheus metrics from ingestion by using a &lt;A href="https://docs.dynatrace.com/docs/shortlink/monitor-prometheus-metrics#filter-metrics" target="_self"&gt;filtering&lt;/A&gt; option, but on the Dynatrace UI (data explorer) the excluded metrics are still visible and AG continues to fetch them. &lt;BR /&gt;&lt;BR /&gt;&lt;/DIV&gt;
&lt;DIV class="lia-message-template-content-zone"&gt;For example, you have configured the exlusion rule like this&lt;/DIV&gt;
&lt;DIV class="lia-message-template-content-zone"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="lia-message-template-content-zone"&gt;&lt;LI-CODE lang="markup"&gt;      annotations:
        metrics.dynatrace.com/filter: |
          {
              "mode": "exclude",
              "names":
              [
                  "sample_request_client_request_bytes_count",
                  "sample_request_client_request_bytes_max",
                  "sample_request_client_request_bytes_sum",
                  "sample_request_client_response_bytes_count",
                  "sample_request_client_response_bytes_max",
                  "sample_request_client_response_bytes_sum",
                  ...
              ]
          }&lt;/LI-CODE&gt;&lt;/DIV&gt;
&lt;H1&gt;&amp;nbsp;&lt;/H1&gt;
&lt;H1 id="toc-hId--1514862007"&gt;&lt;STRONG&gt;Resolution&lt;/STRONG&gt;&lt;/H1&gt;
&lt;P&gt;Looking at the Prometheus metrics from the exposer instance we get this response&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;...
# TYPE sample_request_client_request_bytes summary
# HELP sample_request_client_request_bytes Size of requests in bytes
sample_request_client_request_bytes_count{method="POST",route="/api/v1/app/versions/validate"} 1480.0
sample_request_client_request_bytes_sum{method="POST",route="/api/v1/app/versions/validate"} 345163.0
sample_request_client_request_bytes_count{method="POST",route="/api/v1/labels/sample/get"} 115.0
sample_request_client_request_bytes_sum{method="POST",route="/api/v1/labels/sample/get"} 28352.0
...&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The excluded metrics&lt;SPAN&gt; have an actual name as defined in the “&lt;CODE class="code css-1tbex3z" data-renderer-mark="true"&gt;# TYPE sample_request_client_request_bytes summary&lt;/CODE&gt;” line in Prometheus (here: &lt;CODE class="code css-1tbex3z" data-renderer-mark="true"&gt;sample_request_client_request_bytes&lt;/CODE&gt;), and may contain additional sum and count datapoints with different metric keys (here: &lt;CODE class="code css-1tbex3z" data-renderer-mark="true"&gt;sample_request_client_request_bytes_sum&lt;/CODE&gt; and &lt;CODE class="code css-1tbex3z" data-renderer-mark="true"&gt;sample_request_client_request_bytes_count&lt;/CODE&gt;).&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;When applying the configured operations, the filter groups all data points within a metric together and does not consider the other metric keys contained within this metric. So, in this case the filter will only evaluate the actual metric &lt;CODE class="code css-1tbex3z" data-renderer-mark="true"&gt;sample_request_client_request_bytes&lt;/CODE&gt; but not the &lt;CODE class="code css-1tbex3z" data-renderer-mark="true"&gt;_sum&lt;/CODE&gt; and &lt;CODE class="code css-1tbex3z" data-renderer-mark="true"&gt;_count&lt;/CODE&gt; data points included inside.&lt;BR /&gt;If &lt;CODE class="code css-1tbex3z" data-renderer-mark="true"&gt;sample_request_client_request_bytes&lt;/CODE&gt; is excluded by the filter, the &lt;CODE class="code css-1tbex3z" data-renderer-mark="true"&gt;_sum&lt;/CODE&gt; and &lt;CODE class="code css-1tbex3z" data-renderer-mark="true"&gt;_count&lt;/CODE&gt; data points will also be excluded.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Example of how the correct filtering should look like:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;metrics.dynatrace.com/filter: |
          {
              "mode": "exclude",
              "names":
              [
                  ...
                  "sample_request_client_request_bytes",
                  ...
             ]
          }&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Nov 2024 14:14:55 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Troubleshooting/Excluded-Prometheus-metrics-are-still-fetched-by-ActiveGate/ta-p/262203</guid>
      <dc:creator>shahinm</dc:creator>
      <dc:date>2024-11-12T14:14:55Z</dc:date>
    </item>
  </channel>
</rss>

