Description
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.