And there is an online tool here for testing and visualising alerting configs:
If you want *all* alerts to go to the "boyz" group, then put them at the top - with no "match" clause since you want to match everything, and with "continue".
- receiver: boyz
continue: true
- match:
owner: A
receiver: A_team
Your routes appear to be more verbose than necessary. For example:
- match:
owner: A
receiver: A_team
routes:
- match:
severity: warning
receiver: A_team
- match:
severity: critical
receiver: A_pager
The default receiver in this group is "A_team", so there's no need to match on severity: warning. Hence I think it can simplify to:
- match:
owner: A
receiver: A_team
routes:
- match:
severity: critical
receiver: A_pager
Then:
- if the "severity: critical" is matched, it goes to A_pager
- otherwise it goes to A_team
Now, your second requirement "If it's no route for the critical, then say boyz_pager" is unclear. If you want *all* critical alerts to go to boyz_pager, then put another rule at the top (with continue). If you only want critical alerts which have not been caught already - which means they don't have owner: A or owner: B etc, then put a rule at the bottom. This appears to be what you've done, except you've also matched on owner: boyz, which means only critical alerts with that owner will fire.
If you change your last rule to
- match:
severity: critical
receiver: boyz_pager
then I think it will do what you want: i.e. it catches any alert which hasn't already been matched and is critical.
And if *that* rule doesn't match, it will fall through to using the top-level default receiver (under the top-level "route" block), which in your case is "boyz". I'm not sure if that will end up sending them twice, since you've already sent to 'boyz' earlier. If it's a problem, then make a null receiver.