<p>Is there a way to configure prometheus to ignore scraping metrics for all the resources belonging to a particular namespace? I am not able to figure it out by reading the documentation.</p>

<p>You can drop targets with <code>relabel_config</code> by using <code>drop</code> action. From the <a href="https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config" rel="noreferrer">documentation</a>:</p>
<blockquote>
<p><code>drop</code>: Drop targets for which <code>regex</code> matches the concatenated <code>source_labels</code>.</p>
</blockquote>
<p>Example:</p>
<pre class="lang-yaml prettyprint-override"><code>  relabel_configs:
  # This will ignore scraping targets from 'ignored_namespace_1', 
  # 'ignored_namespace_2', and 'ignored_namespace_N'.
  - source_labels: [__meta_kubernetes_namespace]
    action: drop
    regex: ignored_namespace_1|ignored_namespace_2|ignored_namespace_N
</code></pre>
