prometheus 本身不支持告警功能,通过插件alertmanage来实现告警
Grafana Alerting虽然比较直观,但是相比Alertmanager而言不够灵活,不支持变量

https://blog.51cto.com/u_16213695/9862683

邮件通知和rules配置说明
https://cloud.tencent.com/developer/article/2245015

镜像

prom/alertmanager:v0.25.1   v0.27.0

# 复制配置文件
#docker run -v ./:/temp --rm rss.jobpi.cn/alertmanager:v0.25.1 sh -c "cp -rp /etc/alertmanager/ /temp/"
docker cp alertmanager:/etc/alertmanager/alertmanager.yml ./
  • prometheus/config.yml 插入配置
alerting:
  alertmanagers:
  - static_configs:
    - targets: [ "alertmanager:9093"]

...
global:

启动docker容器

先启动 docker alertmanager
再启动 docker prometheus
# 测试
http://172.16.122.50:9090/
http://172.16.122.50:9093/

报警规则和模板规则

https://blog.csdn.net/weixin_43296313/article/details/117323222
https://cloud.tencent.com/developer/article/2245015