alertmanager.yml51 lines · main
| 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 | |
| 16 | global: |
| 17 | resolve_timeout: 5m |
| 18 | |
| 19 | route: |
| 20 | group_by: ['alertname', 'service'] |
| 21 | group_wait: 30s |
| 22 | group_interval: 5m |
| 23 | # Re-fire every 4h while still firing — avoids alert fatigue but keeps |
| 24 | # the page warm if someone missed the first ping. |
| 25 | repeat_interval: 4h |
| 26 | receiver: deploys |
| 27 | routes: |
| 28 | - matchers: |
| 29 | - severity =~ "critical|warning" |
| 30 | receiver: alerts |
| 31 | continue: false |
| 32 | |
| 33 | receivers: |
| 34 | - name: alerts |
| 35 | webhook_configs: |
| 36 | - url: 'http://alertmanager-discord-alerts:9094/' |
| 37 | send_resolved: true |
| 38 | |
| 39 | - name: deploys |
| 40 | webhook_configs: |
| 41 | - url: 'http://alertmanager-discord-deploys:9094/' |
| 42 | send_resolved: false |
| 43 | |
| 44 | inhibit_rules: |
| 45 | # If a critical fires for a service, suppress redundant warnings on |
| 46 | # the same service for the same alertname. |
| 47 | - source_matchers: |
| 48 | - severity = critical |
| 49 | target_matchers: |
| 50 | - severity = warning |
| 51 | equal: ['alertname', 'service'] |