Victoriametrics: Global external_labels for vmalert

Created on 13 Jul 2020  路  4Comments  路  Source: VictoriaMetrics/VictoriaMetrics

Please implement ability to set external_labels globally to vmalert (same functionality as in vmagent https://prometheus.io/docs/prometheus/latest/configuration/configuration/#scrape_config).

This feature required for adding additional labels (e.g. cluster name, location, ...) to each recording rule.

enhancement vmalert

Most helpful comment

Also I noticed that Prometheus adding global labels (external_labels) to alerts too (it's useful when you can add labels to know from which cluster you got alert)

All 4 comments

Hi @ofen! vmalert allows to specify multiple rule files. Is your intention to set external labels per-file so all the groups in that file would inherit labels? Or you assume some global configuration applied to every configured file?

Hi @ofen! vmalert allows to specify multiple rule files. Is your intention to set external labels per-file so all the groups in that file would inherit labels? Or you assume some global configuration applied to every configured file?

Hi @hagen1778 , I assume global for each configured file. In our current set-up we have vmalert in each cluster (to have separate configuration per cluster) that processing recording rules on remote VictoriaMetrics DB and send it back after processing. We are adding cluster specific labels (name, type, location) to each recording rules but we would like to have ability to apply those cluster wide labels per vmalert instead of per rule.

Also I noticed that Prometheus adding global labels (external_labels) to alerts too (it's useful when you can add labels to know from which cluster you got alert)

The -external.label command-line flag has been added in vmalert v1.39.2. See docs for details.
Closing the issue as done.

Was this page helpful?
0 / 5 - 0 ratings