Alerting: Migrate Slack to use Block Kit#427
Draft
TimShilov wants to merge 4 commits intografana:mainfrom
Draft
Conversation
|
Any update on this PR? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
This is a rough draft, just to start the conversation and get some guidance. It's not polished and not well tested yet.
I'd like to know first, is it something worth finalizing and would maintainers consider merging it if I'll do so?
In this PR I attempted to migrate existing Slack receiver to use Block Kit instead of the legacy attachments (which are discouraged from using by the Slack documentation).
I have migrated it according to the official migration guide.
In this initial migration PR I've tried not to change the way notifications actually look at the moment.
Here's the example of how test alert looked like BEFORE and AFTER the change:
BEFORE:
AFTER:
The only visual differences between BEFORE and AFTER are:
Hopefully, if this will be merged, then it will be possible to actually improve the layout of the Slack notifications to make them look better, and maybe even try to address grafana/grafana#82843 and grafana/grafana#80374 somehow.
Questions/problems to address:
fallbackfield. The documentation suggests to use top-leveltextinstead and it works just fine but ONLY if there's anything in top-levelblocksas well. I've put mentions in that, but if Contact Point isn't configured to mention anyone - then theblocksis empty andtextis actually displayed. So the only way to workaround this is to always have something inside top-levelblocks. It might be a good idea to put thetitleoutside ofattachmentsbut that will look very different from the current notifications.Here's what that could look like
Using markdown
Using header
attachmentsfield at all, but it seems to be the only way to create the colored border. I wonder if we should consider getting rid of the colored border? That not only would allow us to stop using deprecated field, but also would solve the above-mentioned issue withfallback... but the color looks nice. 😬