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

 

posted @ 2021-07-02 11:45  三木燕  阅读(300)  评论(0编辑  收藏  举报