-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
feature request - templated route matcher expressions #4032
Comments
Being able to set things like |
I don't understand how this would work? For example, |
@grobinson-grafana ah ok, sorry about that, was not aware of the matcher rules compare a "property" of an alert, like its Terminology is certainly wrong, but hopefully it still makes sense |
If I understand correct, you want to be able to do something like this: route:
routes:
- matchers:
- alertname =~ "foo{{ .Labels.bar }}.*" But I still don't quite understand what advantages this has for Alertmanager users? However, the big problem is I think this will be almost impossible to implement for one simple reason. These regexes need to be compiled and cached in memory. Right now, the number of regexes is equal to the number of matchers in all routes. But if we need to recompile the regex for every alert, you could end up having to compile millions of regexes (suppose 10,000 alerts, 10 routes, 10 matchers each = 1,000,000 regular expressions). This would cause enormous CPU spikes and I just don't see how we could optimize it. |
Hi,
I see I can define matcher rules like this
what I'd want would be the possibility to leverage the alerts' labels, and the available functions, to dynamically construct that regex with something like
and even
That would let admins define small but dynamic set of rules, that would let users tweak the behavior of the alerting system simply by defining the labels/values of their alerts
The text was updated successfully, but these errors were encountered: