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

EES-5685 - added many additional details to alerts being sent through to Slack #5449

Merged
merged 1 commit into from
Dec 11, 2024

Conversation

duncan-at-hiveit
Copy link
Collaborator

@duncan-at-hiveit duncan-at-hiveit commented Dec 10, 2024

Overview

This PR adds additional useful contextual information to alerts coming through to Slack from Azure Monitor. This is achieved by amending the Logic App to post additional details of the alert to Slack.

Before

Once the alerts were drab, lifeless and unhappy:

image

After

But now, they spring with colour, details and joy!

image

Changes to Logic App workflow

image

Because getting alert details from several layers deep in the alert metric JSON body is very verbose in the Logic App, we now capture a few useful variables ahead of time before creating the Slack message.

We then include:

  • colour-coding based on the severity of the alert if it is firing (red for critical and error, yellow for warning, and green for informational and verbose).
  • colour-coding based on resolved alerts (green)
  • a detailed message about the condition that caused the alert e.g. thresholds, values and operators that are being applied
  • details about the time of the alert testing, firing and resolving
  • links to view the affected resource
  • links to view the timeline of the alert rule that got fired (I wanted to include a link to the actual time of firing that specific alert, but it was a very tricky URL to try to create!)

Testing

The Logic App is currently expecting alert message payloads of the form documented here: https://learn.microsoft.com/en-us/azure/azure-monitor/alerts/alerts-payload-samples#metric-alert-with-a-static-threshold-and-the-monitoringservice--platform

We can manually use this example payload and amend it in different ways within Azure Portal's Logic App Designer Run with payload feature, and test how the Logic App responds to changes to severity, monitoring conditions etc.

… to Slack, including colour-coding based on severity, alert conditions and links to alerts and the affected resources
@tomjonesdev tomjonesdev added the do not merge Don't merge just yet label Dec 11, 2024
@duncan-at-hiveit duncan-at-hiveit removed the do not merge Don't merge just yet label Dec 11, 2024
@duncan-at-hiveit duncan-at-hiveit merged commit 0579422 into dev Dec 11, 2024
8 checks passed
@duncan-at-hiveit duncan-at-hiveit deleted the EES-5685-more-detailed-alerts branch December 11, 2024 10:56
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