Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slack notifier is using a legacy attachment message format #4263

Open
gburek-fastly opened this issue Feb 25, 2025 · 1 comment
Open

Slack notifier is using a legacy attachment message format #4263

gburek-fastly opened this issue Feb 25, 2025 · 1 comment

Comments

@gburek-fastly
Copy link

Alertmanager documents the slack_config as (linking to v0.27 due to formatting issue that may have been fixed in #4247) https://prometheus.io/docs/alerting/0.27/configuration/#slack_config :

The notification contains an attachment.

That link no longer goes to a section about attachments (https://api.slack.com/messaging/composing/layouts#attachments) but forwards to https://api.slack.com/reference/surfaces/formatting#rich-layouts

The documentation for attachments now is at https://api.slack.com/reference/surfaces/formatting#attachments and has the following note:

This feature is a legacy part of messaging functionality for Slack apps. We recommend you stick with Block Kit as above, but if you still want to use attachments, read our caveats below.

The caveats section is as follows:

Secondary attachments are a legacy part of the messaging functionality. While we aren't deprecating them, you should understand that they might change in the future, in ways that reduce their visibility or utility.

We've already mentioned that we recommend the attachments array only contain secondary content that is less important to the intent of the published message. Any content displayed within attachments may be wrapped, truncated, or hidden behind a "show more" style option by Slack clients. This isn't the case with the top-level blocks field.

In short, we recommend you use Block Kit for as much of your message composition as you can, and avoid using attachments if possible. Blocks have many more visual and interactive capabilities available.

Recently, attachments no longer render markdown links for the iOS client, but appear to be fine for desktop and android clients.

While the guidance from Slack is not clear cut (legacy but not deprecated?), moving to the more modern format would help to keep message rendering fully supported in all clients.

@grobinson-grafana
Copy link
Contributor

Please do feel free to open a PR that updates the link in the docs. There are a couple of PRs that looked at adding BlockKit support (including one from me), but I don't see those being merged in the immediate future as more work is needed there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants