From c8cf48a471712c96b8fc102b19df53dc62636080 Mon Sep 17 00:00:00 2001 From: Mat Moore Date: Tue, 21 Apr 2026 10:11:51 +0100 Subject: [PATCH] Remove a section to make slack alerts more concise MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- .../modules/logic-app-slack-alert/main.tf | 23 +------------------ 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/infrastructure/modules/logic-app-slack-alert/main.tf b/infrastructure/modules/logic-app-slack-alert/main.tf index 5f9afb21..1b5c68af 100644 --- a/infrastructure/modules/logic-app-slack-alert/main.tf +++ b/infrastructure/modules/logic-app-slack-alert/main.tf @@ -72,31 +72,10 @@ resource "azurerm_logic_app_action_custom" "post_to_slack" { "type": "header", "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], '`)')))}", "emoji": true } }, - { - "type": "section", - "fields": [ - { - "type": "mrkdwn", - "text": "@{concat('*Severity*\n', triggerBody()?['data']?['essentials']?['severity'])}" - }, - { - "type": "mrkdwn", - "text": "@{concat('*Status*\n', triggerBody()?['data']?['essentials']?['monitorCondition'])}" - }, - { - "type": "mrkdwn", - "text": "@{if(equals(triggerBody()?['data']?['essentials']?['monitorCondition'], 'Resolved'), concat('*Resolved At*\n', triggerBody()?['data']?['essentials']?['resolvedDateTime']), concat('*Fired At*\n', triggerBody()?['data']?['essentials']?['firedDateTime']))}" - }, - { - "type": "mrkdwn", - "text": "@{concat('*Resource*\n`', coalesce(triggerBody()?['data']?['essentials']?['configurationItems']?[0], 'N/A'), '`')}" - } - ] - }, { "type": "section", "text": {