DingTalk

DingTalk#

Alertmanager 没有内置 DingTalk receiver,通常使用 webhook adapter,把 Alertmanager webhook payload 转换成 DingTalk robot API。

1. API / GitHub#

DingTalk custom robot docs:

Known adapter:

2. Adapter Config#

Example:

prometheus-webhook-dingtalk \
  --web.listen-address=:8060 \
  --ding.profile=ops=https://oapi.dingtalk.com/robot/send?access_token=xxx

3. Alertmanager Config#

route:
  receiver: dingtalk-ops

receivers:
  - name: dingtalk-ops
    webhook_configs:
      - url: http://prometheus-webhook-dingtalk:8060/dingtalk/ops/send
        send_resolved: true

4. Template#

如果 adapter 支持自定义模板,建议复用 Alertmanager _index.md 中的通用模板字段:

alertname / status / severity / service / env / summary / description / dashboard_url / runbook_url

5. Notes#

Best Practice:
    DingTalk access_token 不要提交到 Git
    开启签名校验时要同时配置 secret
    critical 告警单独使用一个机器人