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
原文地址:https://www.cnblogs.com/37yan/p/14962630.html