I am trying to drop all but a few whitelisted metrics in prometheus. I can persist them selectively with something like this:
metric_relabel_configs:
- source_labels: [__name__]
regex: (?i)(metric1|metric2|metric3)
action: keep
However I want to drop all of the other, non-matching metrics. Is there any straightforward way to do this?
The keep
action drops everything that doesn't match, so that single action is enough to do what you want.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With