智慧水务管理系统 - 精河县供水工程综合管理平台

alertmanager.yml 1.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. # ============================================================
  2. # AlertManager 配置 - 告警路由与通知
  3. # ============================================================
  4. global:
  5. resolve_timeout: 5m
  6. # ==================== 告警模板 ====================
  7. templates:
  8. - '/etc/alertmanager/templates/*.tmpl'
  9. # ==================== 路由规则 ====================
  10. route:
  11. group_by: ['alertname', 'job']
  12. group_wait: 30s
  13. group_interval: 5m
  14. repeat_interval: 4h
  15. receiver: 'wecom'
  16. routes:
  17. # 严重告警 - 立即通知
  18. - match:
  19. severity: critical
  20. receiver: 'wecom-critical'
  21. group_wait: 10s
  22. repeat_interval: 1h
  23. # 普通告警
  24. - match:
  25. severity: warning
  26. receiver: 'wecom'
  27. repeat_interval: 4h
  28. # ==================== 接收器 ====================
  29. receivers:
  30. # 企业微信通知 - 普通告警
  31. - name: 'wecom'
  32. webhook_configs:
  33. - url: 'http://wecom-alert-proxy:8080/alert'
  34. send_resolved: true
  35. http_config:
  36. follow_redirects: true
  37. # 企业微信通知 - 严重告警
  38. - name: 'wecom-critical'
  39. webhook_configs:
  40. - url: 'http://wecom-alert-proxy:8080/alert-critical'
  41. send_resolved: true
  42. http_config:
  43. follow_redirects: true
  44. # ==================== 告警抑制 ====================
  45. inhibit_rules:
  46. # 同一告警,critical 触发时抑制 warning
  47. - source_match:
  48. severity: 'critical'
  49. target_match:
  50. severity: 'warning'
  51. equal: ['alertname', 'instance']
  52. # 服务宕机时抑制该服务的其他告警
  53. - source_match:
  54. alertname: 'ServiceDown'
  55. target_match_re:
  56. alertname: 'ServiceSlowResponse|HighErrorRate'
  57. equal: ['job']