kubernetes - 使用 prometheus-alertmanager 通过 Grafana UI 发送警报电子邮件
问题描述
我正在尝试使用 prometheus-alertmanager 通知通道通过 grafana UI 测试发送电子邮件警报。我在 alertmanager 的配置文件中添加了 stmp 详细信息。当我尝试测试时,它说电子邮件已发送,但没有真正发生。当我将相同的电子邮件配置添加到 grafana.ini 文件并在 UI 中添加电子邮件通知通道时,我能够发送测试通知。我正在使用以下 helm chart 来安装它 - > https://github.com/helm/charts/tree/master/stable/prometheus-operator 这是 alertmanager 配置文件。
config:
global:
resolve_timeout: 5m
smtp_smarthost: 'email-smtp.us-east-1.amazonaws.com:587'
smtp_from: 'redacted'
smtp_auth_username: 'redacted'
smtp_auth_password: 'redacted'
route:
group_by: ['job']
group_wait: 30s
group_interval: 5m
repeat_interval: 12h
receiver: 'null'
routes:
- match:
alertname: DeadMansSwitch
receiver: 'null'
receivers:
- name: 'null'
这是 grafana 日志。
t=2019-01-28T16:57:38+0000 lvl=info msg="Request Completed" logger=context userId=0 orgId=0 uname= method=GET path=/ status=302 remote_addr=127.0.0.1 time_ms=0 size=29 referer=
t=2019-01-28T16:59:07+0000 lvl=info msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method=POST path=/api/alerts/test status=422 remote_addr=127.0.0.1 time_ms=36 size=82 referer="http://localhost:8000/d/6581e46e4e5c7ba40a07646395ef7b23/k8s-compute-resources-pod?refresh=10s&panelId=0&fullscreen&edit&orgId=1&tab=alert"
t=2019-01-28T16:59:56+0000 lvl=info msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method=POST path=/api/alerts/test status=422 remote_addr=127.0.0.1 time_ms=37 size=82 referer="http://localhost:8000/d/a6e7d1362e1ddbb79db21d5bb40d7137/k8s-use-method-cluster?refresh=10s&panelId=0&fullscreen&edit&orgId=1&tab=alert"
t=2019-01-28T17:01:30+0000 lvl=info msg="Sending Alertmanager alert" logger=alerting.notifier.prometheus-alertmanager ruleId=0 notification=Alert
t=2019-01-28T17:02:30+0000 lvl=info msg="Sending Alertmanager alert" logger=alerting.notifier.prometheus-alertmanager ruleId=0 notification=Alert
t=2019-01-28T17:06:40+0000 lvl=info msg="Sending Alertmanager alert" logger=alerting.notifier.prometheus-alertmanager ruleId=0 notification=Alert
我在这里做错了什么?
解决方案
Prometheus AlertManager 的日志输出丢失。如果警报管理器配置已满,那么您在之后又错过了 2 行
- 名称:'空'
email_configs:
- to: 'myemail@test.com'
推荐阅读
- mysql - MySQL:替代使用“NOT”
- flutter - Flutter:当我传递到另一个屏幕时,实例数据与 Provider 一起丢失
- javascript - 如何选择最后一个 * 之后的句子
- mysql - 从版本 5.7.31 升级到版本 8.0.27 后 MySQL 服务不工作
- mysql - Mysql如何通过'[id,anotherId]'格式加入相关表
- xamarin - Xamarin Community Toolkit LongpressCommand 停止 CollectionView iOS 中的项目选择
- javascript - 如何从我的应用程序中删除标题?为什么会显示页眉?
- c# - 使用 Linq 按月计数和分组
- java - WildFly 19 上的 Spring Boot 2.6 应用程序 - 无法访问我的应用程序
- google-data-studio - Google Data Studio,如何获得所有最大值或最小值的总和