AlertManager - 哪些电子邮件地址被使用了。
示例代码:
在Prometheus配置文件中,我们可以指定AlertManager发送警报通知的电子邮件地址。例如:
route:
receiver: 'email-notifications'
routes:
- match:
alertname: 'HighCPUUsage'
receiver: 'email-notifications'
receivers:
- name: 'email-notifications'
email_configs:
- to: 'user1@example.com,user2@example.com'
send_resolved: true
上面的配置文件指定了当Prometheus监测到名为“HighCPUUsage”的警报时,将通知名为“email-notifications”的接收者,接收者的电子邮件地址为“user1@example.com”和“user2@example.com”。此外,“send_resolved”参数被设置为true,这意味着当警报恢复时也会发送通知邮件。