Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Global external_labels for vmalert #622

Closed
ofen opened this issue Jul 13, 2020 · 4 comments
Closed

Global external_labels for vmalert #622

ofen opened this issue Jul 13, 2020 · 4 comments
Labels
enhancement New feature or request vmalert

Comments

@ofen
Copy link
Contributor

ofen commented Jul 13, 2020

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.

@hagen1778
Copy link
Collaborator

hagen1778 commented Jul 13, 2020

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?

@ofen
Copy link
Contributor Author

ofen commented Jul 13, 2020

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.

@ofen
Copy link
Contributor Author

ofen commented Jul 14, 2020

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)

hagen1778 added a commit that referenced this issue Jul 25, 2020
…all rules #622

`external.label` flag supposed to help to distinguish alert or recording rules
source in situations when more than one `vmalert` runs for the same datasource
or AlertManager.
valyala pushed a commit that referenced this issue Jul 28, 2020
…all rules #622 (#652)

`external.label` flag supposed to help to distinguish alert or recording rules
source in situations when more than one `vmalert` runs for the same datasource
or AlertManager.
valyala pushed a commit that referenced this issue Jul 28, 2020
…all rules #622 (#652)

`external.label` flag supposed to help to distinguish alert or recording rules
source in situations when more than one `vmalert` runs for the same datasource
or AlertManager.
@valyala valyala added the enhancement New feature or request label Jul 30, 2020
@valyala
Copy link
Collaborator

valyala commented Jul 30, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request vmalert
Projects
None yet
Development

No branches or pull requests

3 participants