About this project
This project provides a simple, self-hosted solution for monitoring active alerts from Prometheus Alertmanager. It consists of two independent Go binaries, each packaged as a separate container image, allowing for flexible deployment.
**Components:**
1. **Receiver:** This binary acts as a webhook endpoint for Alertmanager. It listens for POST requests at `/webhook`, processes incoming alert data, and stores the current state in a Valkey (Redis-compatible) database. It specifically handles `Watchdog` alerts by updating a last-seen timestamp without treating them as active issues.
2. **Dashboard:** This binary reads the state from Valkey and serves a web-based HTML dashboard. It also exposes a `GET /api/state` endpoint for programmatic access to the current alert status. The dashboard can be configured to highlight stale updates if no new webhooks have been received within a specified threshold.
**State Management:**
Active alerts are stored in a Valkey hash keyed by their unique fingerprint. Resolved alerts are automatically removed. If a fingerprint is missing, it is derived from sorted labels to ensure consistency.
**Configuration:**
Both binaries are configured via environment variables, including:
- `LISTEN_ADDR`: HTTP listen address (default `:8080`).
- `VALKEY_ADDR`: Address of the Valkey/Redis instance.
- `VALKEY_USERNAME` / `VALKEY_PASSWORD`: Authentication credentials.
- `STALE_AFTER`: Threshold for marking updates as stale (default `90m`).
**Deployment:**
The project supports Docker Compose for local development and testing. Published container images are available on GitHub Container Registry (`ghcr.io`). The final images are optimized for security and size, using `scratch` as the base, running as non-root (UID/GID 1000), and including binary-backed health checks.
Comments
0 Rating appears after 10 ratings
Sign in to join the discussion.