alertmanager
alertmanager copied to clipboard
notify/discord: Create Discord integration
For our https://demo.parca.dev instance we want to alert to be send to Discord. Therefore I've worked on integrating Discord directly into Alertmanager.
The integration doesn't need any external dependencies and uses JSON to send the payloads to Discord via webhooks to a specific channel.
This integration is already in use for our alerting for a week now and has been working great so far.
This integration was heavily inspired by the work done in https://github.com/benjojo/alertmanager-discord Thanks for your hard work @benjojo.
Ah ha! Sorry for not getting around to the original, but thanks for doing this anyway!
Ah ha! Sorry for not getting around to the original, but thanks for doing this anyway!
No worries. This is how it works in open source, I guess. :relaxed:
LGTM - I think the template can look better (e.g. better formatting when having multiple alerts and adding a link to the silences) but let's see what kind of feedback we get after people start using it.
Overall the messages in Discord could look way better indeed. However, most of the notifications use the same default template for messages. Hence, I opted to use the same one. It's always possible to write custom templates and use them with alertmanager.
Are we waiting on something? Honestly don't remember.
Does someone want to merge this? I can do that myself, but don't feel like that's a best practice. :)
Hey! I'd like to hear from @gotjosh before merging. But since he's busy these days, I propose to merge it next week in case of no answer from him.
Given it's been a lot more days, I'll go ahead and merge this. Let me know if there's something we should follow this up with!
@metalmatze Hi, I just noticed that the docs for this are still missing at https://prometheus.io/docs/alerting/latest/configuration/ (source: https://github.com/prometheus/alertmanager/blob/main/docs/configuration.md). Could you add those as well?
Hey, thanks for the ping. I bookmarked this issue in the hopes to remind myself in my free time to make the contribution.
@metalmatze I can take a stab at it today if that's ok with you. If it remains undocumented, it's basically like the feature doesn't exist, so I think it's good to do it now :)
PR out at https://github.com/prometheus/alertmanager/pull/3201