alertmanager.yml 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. # briven alertmanager config — routes prometheus alerts to discord.
  2. #
  3. # we use the benjojo/alertmanager-discord bridge as a sidecar because
  4. # alertmanager's webhook_configs posts a prometheus-shaped JSON that
  5. # discord doesn't understand. the bridge translates one format into the
  6. # other and posts to the discord webhook URL — see compose.yml.
  7. #
  8. # two routes:
  9. # severity=critical|warning → #briven-alerts (pageable)
  10. # everything else (info) → #briven-deploys (info stream)
  11. #
  12. # both bridge instances run as separate services so each can hold a
  13. # different DISCORD_WEBHOOK env. alertmanager itself only knows about
  14. # the two http://… endpoints inside the docker network.
  15. global:
  16. resolve_timeout: 5m
  17. route:
  18. group_by: ['alertname', 'service']
  19. group_wait: 30s
  20. group_interval: 5m
  21. # Re-fire every 4h while still firing — avoids alert fatigue but keeps
  22. # the page warm if someone missed the first ping.
  23. repeat_interval: 4h
  24. receiver: deploys
  25. routes:
  26. - matchers:
  27. - severity =~ "critical|warning"
  28. receiver: alerts
  29. continue: false
  30. receivers:
  31. - name: alerts
  32. webhook_configs:
  33. - url: 'http://alertmanager-discord-alerts:9094/'
  34. send_resolved: true
  35. - name: deploys
  36. webhook_configs:
  37. - url: 'http://alertmanager-discord-deploys:9094/'
  38. send_resolved: false
  39. inhibit_rules:
  40. # If a critical fires for a service, suppress redundant warnings on
  41. # the same service for the same alertname.
  42. - source_matchers:
  43. - severity = critical
  44. target_matchers:
  45. - severity = warning
  46. equal: ['alertname', 'service']