Alertmanager to Statuspage Bridge
An open-source bridge that keeps Atlassian Statuspage incidents up to date on its own, straight from Prometheus Alertmanager alerts.
Context: Briefing
When you set up monitoring with Prometheus and Alertmanager, you quickly run into the same problem: Alertmanager knows exactly when something breaks, but the status page your users actually look at knows nothing until someone opens it and creates the incident by hand. So outages get announced late, inconsistently, or not at all.
So I wrote a small Python service that sits between the two. It receives Alertmanager’s webhooks, opens the matching Statuspage incident when an alert fires, keeps it updated as related alerts come and go, and closes it on its own once everything is back to normal. I then documented it, tested it and published it as open source under the MIT license.
What I did: Objectives cleared
- A FastAPI service that receives Alertmanager webhooks, both firing and resolved, protected by a shared secret.
- Incidents grouped per Statuspage component rather than per alert: when two alerts hit the same component, they stack onto one incident, which gets escalated, instead of opening two.
- The incident’s impact comes from the alert’s real severity, and components are looked up by name, so nobody has to hardcode Statuspage IDs in their alerting rules.
- Running incidents saved to disk after every change with an atomic write, so a crash in the middle of a write never corrupts the state.
- Shipped as a Docker image with a healthcheck and a Docker Compose setup, with pytest tests and linting run in CI on GitHub Actions.
Hardest problem: Boss fight
Always matching the real state of the systems
Creating incidents was the easy part. The hard part was making sure they always matched reality: an alert can be resolved while the bridge is down, a resolved webhook can get lost, Alertmanager can send the same alert several times, and after a restart or a crash the bridge has to remember which incidents it left open. I made every operation idempotent, saved the state after each change, and added a reconciliation pass that runs at startup and then at regular intervals, compares open incidents with the alerts actually active in Alertmanager, and closes whatever is no longer firing. Even when an event goes missing, Statuspage ends up reflecting what is really going on.
Results: Rewards
- No more incidents to open, update or close by hand
- Published as open source on GitHub, documented and tested