Extend Discord Notifier
This PR extends the Discord notifier to improve the readability of alerts. It changes 5 key elements:
- A configureable icon as bot Logo (I'm currently using the GitHub Avatar. Is that alright? Is there a better way for doing this?)
- A configurable name for the bot
- Alert-ID in the footer
- Start & end times in the footer (Even if the message is sent with a delay, the correct time will be displayed)
- It uses Discords fields-feature to display labels
- It sends one message per alert
It also fixes UI builds on apple silicon by forcing the linux/amd86 platform for the elm container
Before:
This looks nice! Thank you very much for your contribution -- can you please show me an example of the after with multiple labels?
This looks nice! Thank you very much for your contribution -- can you please show me an example of the after with multiple labels?
Sure! Desktop:
I'm also planing to change the title to not include the labels anymore
Small update:
I'd love to get some first feedback @gotjosh
Hey. I‘d love to get some feedback on this.
I‘ll correct a few minor things this weekend. Afterwards it should be ready to be merged
The visual changes look nice! You'll need to remove the one message per alert change though as it interferes with alert grouping behavior. For example, if a user wants one message per alert then grouping can be disabled in the route, like so:
route:
receiver: test
group_by: ['...']
You can find it documented here.
Good catch! Thank you!
The visual changes look nice! You'll need to remove the one message per alert change though as it interferes with alert grouping behavior. For example, if a user wants one message per alert then grouping can be disabled in the route, like so:
route: receiver: test group_by: ['...']You can find it documented here.
Could you please have a look at the latest changes? Grouping is now allowed by only sending one message per alert - containing as much 'embeds' (those alert boxes you're seeing) as allowed per Discord API limits. Is it okay like that?
I still have to clean the code up and make it a bit more readable before this is ready to be merged tho. (Argh.. and signing off the past commits. I always forget to do it.. I will add a signed-off git message template now 😄)
I noticed that when the maximum number of embeds is exceeded, just the first embed is sent? Is that expected? Looking at the code I would expect 10 embeds to be sent with the truncation message rather than just 1 embed?
I'd love to finalize this and get this into 0.27.1. @gotjosh could you please have a look at the discussions above?
I've been waiting for over two months now, and my PR still hasn't been fully reviewed, nor have my questions been answered. I know everyone is busy, but it's getting a bit frustrating. I'd love to help improve the software we all use day to day, but I'm not sure if I can keep contributing if things don't change.
For those who might not know what I'm talking about, here is my current focus: Improving Discord Integration in Alertmanager.
- Implemented features aren't tested at all (see: https://github.com/prometheus/alertmanager/pull/3555)
- No problem. I'll write a fix for that. Only That the fixes aren't released (see: https://github.com/prometheus/alertmanager/pull/3728#issuecomment-1969078303 "I'm going to release v0.27.1 relatively soon [...]")
- PRs aren't getting reviewed in time. (see: this one)
Please don't get me wrong; I love your work and want to keep contributing. I do honor your tight schedules. It's just getting a little... frustrating for me and, looking at the comments on some of the PRs, for many others as well.
Hi Luca! 👋
I think we are still waiting on some changes since the last time, no?
You're right. I'm gonna refactor this - using the embed title for displaying the alert summary (CommonAnnotations.summary) and adding the total alert count to the message above the embeds.
I don't see any commits since this comment, is this still something you want to change?
I noticed that when the maximum number of embeds is exceeded, just the first embed is sent? Is that expected? Looking at the code I would expect 10 embeds to be sent with the truncation message rather than just 1 embed?
I believe this isn't working as it should, did you get time to take a look?
I solved some locally without pushing because I'm waiting for the discussions above to resolve. As long as I don't know what way you want me to implement things, I don't know how to continue working on this.
See: My last comment:
I'd love to finalize this and get this into 0.27.1. @gotjosh could you please have a look at the discussions above?
Waiting for someone else to comment on it:
Waiting on anyone to comment on it:
I solved some locally without pushing because I'm waiting for the discussions above to resolve. As long as I don't know what way you want me to implement things, I don't know how to continue working on this.
Oh! Please push those changes so we can take a look! I think those two (repeated title and missing embeds) are unrelated to the other discussions so 100% recommend we push those fixes to be reviewed 👍
Waiting for someone else to comment on it:
I'll check in with @gotjosh, let's keep making progress on the remaining issues and we can come back to this! 👍
Waiting on anyone to comment on it:
I'm not sure I see where #3821 is adding a skip_fields field? I think my opinion is unchanged on this topic – let's remove it and add it back if it turns out users need it.
Hi @LucaDev! Do you want to push the changes you made so we can take a look?

