<p>I'm using the <a href="https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-prometheus-stack" rel="nofollow noreferrer">kube-prometheus-stack</a> chart and I'm trying to get rid of all the <code>kube_secret</code> metrics.</p>
<p>When I query these metrics I see that they originate from a job named <code>kubernetes-service-endpoints</code>, but I can't figure out what service monitor controls it in <a href="https://github.com/prometheus-community/helm-charts/blob/main/charts/kube-prometheus-stack/values.yaml" rel="nofollow noreferrer"><code>values.yaml</code></a>, so I tried dropping them from every single configurable service monitor - in each one of them I put:</p>
<pre class="lang-yaml prettyprint-override"><code>    metricRelabelings:
    - action: drop
      regex: 'kube_secret_.+'
      sourceLabels: [__name__]
</code></pre>
<p>Didn't help of course. What do I need to define in <code>values.yaml</code> in order to drop those metrics?
Thanks</p>

towel
<p>I'm silly - I defined the <code>kubernetes-service-endpoints</code> job in <code>prometheus.prometheusSpec.additionalScrapeConfigs</code>...</p>
<p>In order to remove all <code>kube_secret</code> metrics I dropped metric names that matched <code>kube_secret_.+</code> for this job and in the service monitor of <code>kubeStateMetrics</code> (<code>kubeStateMetrics.serviceMonitor.metricRelabelings</code>)</p>
