Skip to content

Remove a section to make slack alerts more concise#288

Closed
MatMoore wants to merge 1 commit into
mainfrom
make-slack-alerts-more-concise
Closed

Remove a section to make slack alerts more concise#288
MatMoore wants to merge 1 commit into
mainfrom
make-slack-alerts-more-concise

Conversation

@MatMoore
Copy link
Copy Markdown

Description

This change moves the resource and severity fields into the heading, so it will look something like:

✅ Sev1 resolved – appi-preprod-uks-manbrs-exceptions-alert (resource: appi-preprod-uks-manbrs)

It also drops the fields for Status and Resolved at, since the heading already contains whether it is resolved or not, and we have the time the slack message was received at as a proxy for alert times.

Otherwise I've tried to keep all the same sources of information. I did wonder though if we can replace appi-preprod-uks-manbrs-exceptions-alert with a human readable alert name? If we do that maybe the resource part is not neccessary.

We could also maybe hide the description if the alert is resolved, as in that case you only need enough info to identify what's been resolved.

Context

The current alerts take up a lot of vertical space in slack, which means they tend to drown out other messages in the channel and limit the number of messages visible at once.

Type of changes

  • Refactoring (non-breaking change)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would change existing functionality)
  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • I am familiar with the contributing guidelines
  • I have followed the code style of the project
  • I have added tests to cover my changes
  • I have updated the documentation accordingly
  • This PR is a result of pair or mob programming

Sensitive Information Declaration

To ensure the utmost confidentiality and protect your and others privacy, we kindly ask you to NOT including PII (Personal Identifiable Information) / PID (Personal Identifiable Data) or any other sensitive data in this PR (Pull Request) and the codebase changes. We will remove any PR that do contain any sensitive information. We really appreciate your cooperation in this matter.

  • I confirm that neither PII/PID nor sensitive data are included in this PR and the codebase changes.

The current alerts take up a lot of vertical space in slack, which means
they tend to drown out other messages in the channel.

This change moves the resource and severity into the heading, so it will look
something like:

Sev1 resolved – appi-preprod-uks-manbrs-exceptions-alert (resource: appi-preprod-uks-manbrs)

It also drops the fields for Status and Resolved at, since the heading
contains whether it is resolved or not, and we have the time the slack message
was received at as a proxy for alert times.
"text": {
"type": "plain_text",
"text": "@{if(equals(triggerBody()?['data']?['essentials']?['monitorCondition'], 'Resolved'), concat('✅ Resolved – ', triggerBody()?['data']?['essentials']?['alertRule']), concat('🚨 Alert – ', triggerBody()?['data']?['essentials']?['alertRule']))}",
"text": "@{concat(if(equals(triggerBody()?['data']?['essentials']?['monitorCondition'], 'Resolved'), concat('✅ ', triggerBody()?['data']?['essentials']?['severity'], ' resolved'), concat('🚨 ', triggerBody()?['data']?['essentials']?['severity'], ' alert')), ' – ', triggerBody()?['data']?['essentials']?['alertRule'], if(empty(coalesce(triggerBody()?['data']?['essentials']?['configurationItems']?[0], '')), '', concat(' (resource: `', triggerBody()?['data']?['essentials']?['configurationItems']?[0], '`)')))}",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The type for the header is plain_text — may need to switch to mrkdwn to get formatting for the backticks used here.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep makes sense.

I'm not really happy with this PR as it is though, so going to close it for now as I don't really have the bandwidth to get it into a good state atm. The result is still verbose and it might be better to come up with a new format from scratch.

I think you should be able to see at a glance what the error is about. Ideally I would swap out terraform names like "appi-preprod-uks-manbrs-exceptions-alert" for descriptive text like "high exception rate: manage-breast-screening".

@MatMoore MatMoore closed this May 12, 2026
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

Successfully merging this pull request may close these issues.

2 participants