When creating a Slack receiver, the adv. config. options only allow user to customize an icon and the username. We should also add textareas for Title and Text which would allow user to fully customize the alert messages sent to Slack. Example yaml: receivers: - name: Critical slack_configs: - channel: '#critical-alerts' icon_emoji: ':exclamation:' username: dtaylor113 link_names: false title: >- {{ .CommonLabels.alertname }} {{ if eq .Status "firing" }}({{ .Alerts.Firing | len }}{{ end }} {{ .Status }}) text: >- {{ range .Alerts -}} *Alert:* {{ .Annotations.title }}{{ if .Labels.severity }} - `{{ .Labels.severity }}`{{ end }} *Message:* {{ .Annotations.message }} *Description:* {{ .Annotations.description }} *Details:* {{ range .Labels.SortedPairs }} • *{{ .Name }}:* `{{ .Value }}` {{ end }} {{ end }} - name: Warnings slack_configs: - channel: '#warning-alerts' icon_emoji: ':warning:' title: >- {{ .CommonLabels.alertname }} {{ if eq .Status "firing" }}({{ .Alerts.Firing | len }}{{ end }} {{ .Status }}) text: >- {{ range .Alerts -}} *Alert:* {{ .Annotations.title }}{{ if .Labels.severity }} - `{{ .Labels.severity }}`{{ end }} *Summary:* {{ .Annotations.message }} *Message:* {{ .Annotations.message }} *Description:* {{ .Annotations.description }} *Details:* {{ range .Labels.SortedPairs }} • *{{ .Name }}:* `{{ .Value }}` {{ end }} {{ end }}
Tested on ocp 4.8 cluster with payload 4.8.0-0.nightly-2021-02-21-102854. Create slack alert receivers with default title/text and custom title/text, could get alert info successfully. Refer to attachment. The bug is fixed.
Created attachment 1758569 [details] defaultext
Created attachment 1758570 [details] customtext
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (Moderate: OpenShift Container Platform 4.8.2 bug fix and security update), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2021:2438