Option 3: use child routes. This avoids duplicating the match conditions.
- match:
type: alert_alert
routes: [ {receiver: receiverOne, continue: true}, {receiver:
receiverTwo} ]
The 'routes' branch is a separate subtree. Since each of the routes within
it has no 'match' conditions, it implicitly matches everything, delivering
to each of the receivers listed. You need continue: true on each of them,
except for the last.
On Tuesday, 22 November 2022 at 16:46:07 UTC Julien Pivotto wrote:
> On 22 Nov 08:30, Nenad Rakonjac wrote:
> > Hi everyone,
> >
> > Is it possible to use two receivers for one alert? I want to implement
> > something like this:
> >
> > - match:
> > type: alert_alert
> > receiver: receiverOne
> >
> > - match:
> > type: alert_alert
> > receiver: receiverTwo
> >
> > receivers:
> >
> > - name: receiverOne
> > email_configs:
> > - to: '[email protected]'
> > from: '[email protected]'
> >
> > - name: receiverTwo
> > email_configs:
> > - to: '[email protected]'
> > from: '[email protected]'
> >
>
>
> you have two solutions:
>
> 1. use continue: true
>
> - match:
> type: alert_alert
> receiver: receiverOne
> continue: true
> - match:
> type: alert_alert
> receiver: receiverTwo
>
> 2. combine the receivers
>
> - name: receiverOne
> email_configs:
> - to: '[email protected]'
> from: '[email protected]'
> - to: '[email protected]'
> from: '[email protected]'
>
> > --
> > 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/08996072-a8c0-4ab8-b0fe-0bb89c88e7ben%40googlegroups.com
> .
>
>
> --
> Julien Pivotto
> @roidelapluie
>
--
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/d7b3b8cd-7611-416e-8bf5-ea775c0db63an%40googlegroups.com.