Thank you for your email, I had omitted the receiver and tried this below
and it came up with an error message that i must specify a default receiver
route:
  routes: [ { receiver: send_email, continue: true}, { receiver:
send_email2 } ]
Plus in your last statement, is it possible to have just one send_email
reciever configured for two email addresses?

On Thu, 10 Oct 2024 at 13:32, 'Brian Candler' via Prometheus Users <
[email protected]> wrote:

> route:
>   receiver: send_email
>   routes:
>     - receiver: send_email2
>
> That route will only ever send to send_mail2. Why?
>
> "routes" are child routes of this route. When processing a given routing
> rule, alertmanager scans through all the child routes in turn, and the
> first one which matches is used. Only if *none* of them match, does it fall
> back to using the "receiver" at the top level of the routing rule.
>
> In your case, there is one child rule, and it always matches (because it
> has no conditions). It sends the mail to send_email2, and then terminates.
> Nothing more happens, and the fallback "receiver" is never used.
>
> If you want to send to both, then you would have two child routes:
>
> route:
>   receiver: dontcare    # you can omit this line entirely (it's never used)
>   routes:
>     - receiver: send_email
>       continue: true
>     - receiver: send_email2
>
> "continue: true" is required so that after matching the first route, it
> continues to the next one instead of giving up immediately.
>
> You can write this in a more compact one-line form where [ ... ] is a list
> and { ... } is an object:
>
> route:
>   routes: [ { receiver: send_email, continue: true}, { receiver:
> send_email2 } ]
>
> ...and that's what I showed before.
>
> But if all your alerts need to go to both E-mail addresses, it would be
> simpler to have a single "send_email" receiver with two E-mail addresses.
>
> --
> 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/59def785-af04-48a6-8c0f-4a1f394eae29n%40googlegroups.com
> <https://groups.google.com/d/msgid/prometheus-users/59def785-af04-48a6-8c0f-4a1f394eae29n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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/CAL2E%2B82DxiL9Kk07EcH2aK_AoJns04qahSVVWRCLnT69sOvPbQ%40mail.gmail.com.

Reply via email to