Skip to content

🚨 Take your alertmanager alerts into Discord. 🚨

License

Notifications You must be signed in to change notification settings

SimplicityGuy/alertmanager-discord

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

alertmanager-discord

alertmanager-discord License: MIT pre-commit

Give this a webhook (with the DISCORD_WEBHOOK environment variable) and point it as a webhook on alertmanager, and it will post your alerts into a discord channel for you as they trigger:

Example Notification

Warning

This program is not a replacement to alertmanager, it accepts webhooks from alertmanager, not Prometheus.

The standard data flow should be:

flowchart LR;
    Prometheus==>alertmanager;
    alertmanager==>alertmanager-discord;
Loading

Example Prometheus config:

alerting:
  alertmanagers:
    - static_configs:
      - targets:
        - 127.0.0.1:9093

Example alertmanager config:

receivers:
- name: 'discord_webhook'
  webhook_configs:
    - url: 'http://localhost:9094'

Example alertmanager-discord config:

environment:
  - DISCORD_WEBHOOK=https://discordapp.com/api/we...

Complete example alertmanager config:

global:
  # The smarthost and SMTP sender used for mail notifications.
  smtp_smarthost: 'localhost:25'
  smtp_from: '[email protected]'
  smtp_auth_username: 'alertmanager'
  smtp_auth_password: 'password'

# The directory from which notification templates are read.
templates:
- '/etc/alertmanager/template/*.tmpl'

# The root route on which each incoming alert enters.
route:
  group_by: ['alertname']
  group_wait: 20s
  group_interval: 5m
  repeat_interval: 3h
  receiver: discord_webhook

receivers:
- name: 'discord_webhook'
  webhook_configs:
  - url: 'http://localhost:9094'

Docker

Please see alertmanager-discord for builds.

Languages

  • Go 77.1%
  • Dockerfile 22.9%