You can make a nested tree of routes, which in effect gives you an "if ...
then ... else ..." capability.
routes:
- ... something to do always
continue: true
- match:
severity: critical
routes:
- ... things to do when critical
- ...
- ... things to do when not critical
- ...
Leaving out the "match" condition entirely makes a rule match always.
Note that "continue: true" carries on to the next rule after a match, but
only at the same level. It will only fall out to the parent ruleset if no
matches occur.
Or of course, you can explicitly match all non-critical severities e.g.
match_re:
severity: 'debug|informational|warning'
As to why what you wrote before didn't work:
1. The supported regex syntax for go's re2 library is defined here:
https://github.com/google/re2/wiki/Syntax
The (?!...) form is not implemented, due to the non-backtracking design of
re2.
2. I don't know why you thought "not_match_re" would work, but it's not
defined here:
https://prometheus.io/docs/alerting/configuration/
I would have hoped that alertmanager would fail to start when given unknown
config tag. If it didn't, then that could be a bug.
--
You received this message because you are subscribed to the Google Groups
"Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/prometheus-users/10e84b62-f9fe-4578-938b-fb4f6de613a0%40googlegroups.com.