On Friday, 26 November 2021 at 16:04:37 UTC [email protected] wrote:

> What should be added or changed if i want to send the alerts that matches 
> this labels typeofalert="statuspal" to [email protected] as well along with 
> [email protected].
>

The simplest way is to make a new receiver with multiple entries, and route 
to that:

receivers:
- name: 'App-Kafka-Support-and-Statuspal'
  email_configs:
  - to: '[email protected] <https://groups.google.com/>'
    send_resolved: true
  - to: '[email protected] <https://groups.google.com/>'
    send_resolved: true
    headers:
      subject: '{{ if eq .Status "firing" }}DOWN{{ else if eq .Status 
"resolved" }}UP{{end}}'

But you can also have separate receivers.  For example, if you want to send 
all alerts to receiver App-Kafka-Support *in addition* to any other 
receivers with explicit routes, then you can put a catch-all route at the 
top:

route:
  group_by: ['alertname']
  group_wait: 10s
  group_interval: 10s
  repeat_interval: 5m
  receiver: 'dontcare'
  routes:
  - receiver: 'App-Kafka-Support'
    continue: true
  - receiver: 'Statuspal'
    matchers:
    - typeofalert="statuspal"

 

> Could you please provide more information on the parameter continue:true 
> and its significance please.
>

It is described 
here: https://prometheus.io/docs/alerting/latest/configuration/#route

*If continue is set to false, it stops after the first matching child. 
If continue is true on a matching node, the alert will continue matching 
against subsequent siblings. If an alert does not match any children of a 
node (no matching child nodes, or none exist), the alert is handled based 
on the configuration parameters of the current node.*

I think that's pretty clear.  If it doesn't match rule N, then it moves to 
rule N+1.  If it does match N, but has continue: true, then it also moves 
to rule N+1.  The top-level receiver is only used if *none* of the rules 
matched, with or without "continue: true".

Therefore, "continue: true" on the final route makes no difference.

-- 
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/005bd7e7-112f-4fb9-9d59-c966783005cbn%40googlegroups.com.

Reply via email to