Situatie
Summary
Alertmanager will POST alerts to a small webhook service you host (/alert-enrich) that:
-
parses incoming alerts,
-
appends a runbook URL or short remediation steps based on alert labels (e.g.,
alertname,instance), -
forwards the enriched message to Slack via an Incoming Webhook.
Components
-
Alertmanager config change to call webhook.
-
A tiny Python Flask service that enriches alerts and forwards to Slack.
-
Slack Incoming Webhook URL stored securely.
Solutie
Alertmanager snippet
Add to receivers:
Then route important alerts to webhook-enrich.
Python enricher (alert_enricher.py)
Steps
-
Create Slack Incoming Webhook and save URL.
-
Deploy
alert_enricher.pyon a small container/VPS, setSLACK_WEBHOOKenv var. -
Update Alertmanager
receiversto point to the public URL of the enricher. -
Add runbook mapping (either static like above, or store runbooks in a repo / DB and fetch dynamically).
-
Test by sending a synthetic alert through Alertmanager API.
Enhancements
-
Add deduplication & rate-limiting in the enricher.
-
Include escalation links and PagerDuty integration.
-
Support richer Slack blocks with buttons (e.g.,
I am investigating). -
Attach recent logs by querying Loki or ELK (if available) and embedding a short excerpt.
Troubleshooting & notes
-
Ensure Alertmanager can reach the webhook (network, firewall)
-
Protect the webhook endpoint (IP allowlist or a shared secret)
-
For high volume, use a queue (RabbitMQ/SQS) to avoid blocking Alertmanager retries.
Leave A Comment?