Alertmanager 配置解析

配置文件

global:
  resolve_timeout: 5m
  smtp_from: ops@example.com
  smtp_smarthost: smtp.exmail.qq.com:465
  smtp_hello: k8s
  smtp_auth_username: ops@example.com
  smtp_auth_password: <secret>
  smtp_require_tls: false

route:
  group_by: [alertname]
  group_wait: 30s
  group_interval: 30s
  repeat_interval: 24h
  receiver: Default
  routes:
  - match:
      alertname: Watchdog
    receiver: Watchdog
  - match_re:
      severity: critical  
    receiver: ops
    repeat_interval: 1h
  - match_re:
      severity: warning  
    receiver: ops
    repeat_interval: 3h    

receivers:
- name: 'Default'
- name: 'Watchdog'

- name: 'ops'
  email_configs:
  - send_resolved: true
    to: sre@example.com
    headers: 
        Subject:  '{{ template "email.default.subject" . }} k8s'  
  webhook_configs:
  - send_resolved: true
    url: https://dingtalk-robot.example.com/dingtalk/k8s/send

 

上一篇:Kubernetes(k8s)监控报警之快速安装手册-使用Prometheus和alertmanager及node_exporter和kube-state-metrics


下一篇:k8s监控体系搭建prometheus+grafana+alertmanager无坑版