> That was just a way to get around not being able to define a set of
matchers for 1 receiver.
What I'm saying is, routing rules are an ordered list of independent rules
which are tested in turn, and each one can trigger the same or different
receivers. For example:
- receiver: 'SpecialUser'
match_re:
alertname: 'TargetDown'
instance: 'host1|host2'
- receiver: 'SpecialUser'
match_re:
alertname: 'ProbeFailing'
instance: 'https://site.mydomain.com/login'
For each rule, the conditions are first tested. If all conditions pass (or
there are no conditions), then the child "routes" (if any) are processed.
If there are no child routes, or none of them match, then the "receiver" is
used as the destination.
If the conditions don't all pass, or if continue: true is set, then
processing continues with the next rule.
You may find it easier to read each rule if you put the matcher
attribute(s) before the receiver attribute:
- match_re:
alertname: 'TargetDown'
instance: 'host1|host2'
receiver: 'SpecialUser'
- match_re:
... etc
> Here's what I want.
> - ALL notifications go to my 'default' receiver. (host1,2,3,....host99
are down, sites A,B,C.... is down, etc.)
> - 3 specific notifications ALSO go to a 'secondary' receiver (host2 is
down or host3 is down or siteC is down)
There are a couple of ways to do that. Either you put the "ALL
notifications" rule first (as you have done) with continue: true; or you
put the "ALL notifications" rule at the end. That depends on whether you
want to have the ability for individual rules to suppress the "all
notifications" or not. If all rules have "continue: true" then it doesn't
matter.
> Since both my "host down" and "site down" alarms each require 2 labels
(alertname and instance) do I need two routing rules?
Yes.
> How would I do that using matchers
- matchers:
- 'alertname="TargetDown"'
- 'instance=~"host1|host2"'
receiver: 'SpecialUser'
- matchers:
- ... etc
--
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/a8c94a15-b37c-484d-b93f-c31875d37fddn%40googlegroups.com.