WeChat#
Alertmanager 内置 wechat_configs,可对接企业微信。
1. API / Config#
docs:
- https://prometheus.io/docs/alerting/latest/configuration/#wechat_config
- https://developer.work.weixin.qq.com/document/path/90236
2. Alertmanager Config#
global:
wechat_api_url: https://qyapi.weixin.qq.com/cgi-bin/
wechat_api_secret: ${WECHAT_API_SECRET}
wechat_api_corp_id: ${WECHAT_CORP_ID}
route:
receiver: wechat-platform
receivers:
- name: wechat-platform
wechat_configs:
- send_resolved: true
agent_id: "1000002"
to_party: "1"
message: '{{ template "alert.text" . }}'3. Notes#
Best Practice:
corp_id / api_secret 使用 Secret 管理
to_party / to_user 根据团队拆分
message 内容保持短,详细排障放 runbook_url