benjojo / alertmanager-discord

Take your alertmanager alerts, into discord
Apache License 2.0
177 stars 78 forks source link

Configuration file to manage multiple WebHooks #10

Open FinweVI opened 3 years ago

FinweVI commented 3 years ago

Hello,

if we want to send alerts to various Discord Channels, each Channel having it's own WebHook, we have to run multiple instances of alertmanager-discord.

It could be nice to have a YAML configuration file storing endpoints and WebHooks.

For instance:

webhooks:
  - name: "channel1"
    webhook: "https://discord.com/api/webhooks/..."
  - name: "channel2"
    webhook: "https://discord.com/api/webhooks/..."

With alertmanager-discord having a routed endpoint on http://127.0.01:9094/channel1 and http://127.0.01:9094/channel2.

This would allow to send alerts to an infinite amount of channels with only one running daemon.

My Go is not top-nocht but I'm willing to try for a PR if there's any chance for it to be accepted.