Right now I'm scraping metrics from a Node Exporter. Some of the metrics which the Node Exporters exports have a mountpoint
label.
I'd like to drop time series that have this label and do not match a regular expression. I tried using the keep
action (as I'd like to keep time series that do match this regular expression) but this also drops all other metrics that do not have the mountpoint
label.
metric_relabel_configs:
- source_labels: ['mountpoint']
regex: '(\/home|\/var\/domains)\/something.*'
action: keep
I tried using the drop
action too but this requires me to inverse the regular expression using a negative-lookahead (which isn't supported because Prometheus is written in Go of course).
What are my options in this?
Important, I do not have control over the way the Node Exporter is configured, thus I can't configure the Node Exporter itself to not export metrics for some specific mountpoint (if this is even possible).