I've been trying to drop unused metrics (before scrape) to lighten the load on a Prometheus cluster via relabel_configs:
- job_name: nginx-ingress-controller-metrics
kubernetes_sd_configs:
- role: endpoints
namespaces:
names:
- <some-namespace>
relabel_configs:
# single
- source_labels: [__name__]
regex: nginx_ingress_controller_response_size_bucket
action: drop
# multiple
- source_labels: [__name__]
regex: nginx_ingress_controller_(request_size_bucket|response_duration_seconds_bucket|bytes_sent_bucket|bytes_sent_sum)
action: drop
However, I am not seeing any of these metrics dropped (before scrape) and they are scraped and ingested as I can query them via PromQL.
I've tried many variations of the same config (i.e. quotes, parentheses, etc.). Any idea why these targets are still scraped/ingested?