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.

Reply via email to