A watcher for Alertmanager
Project description
COS Alerter
COS Alerter is intended to be used together with alertmanager and prometheus:
- Liveness of Alertmanager through an always-firing alert rule ("Watchdog")
- Liveness of COS Alerter itself from a metric endpoint it exposes and prometheus scrapes
Configuring Alertmanager
In order to integrate with COS Alerter you need to add a heartbeat rule to Prometheus and add a route to the Alertmanager config.
If you are using the Canonical Observability Stack, the alert rule is already created for you. If not, you can use a rule similar to the following:
- alert: Watchdog
annotations:
summary: A continuously firing alert that ensures Alertmanager is working correctly.
expr: vector(1)
labels:
severity: none
Add the following to your alertmanager config to create the route:
receivers:
...
- name: cos-alerter
webhook_configs:
- url: http://<cos-alerter-address>:8080/alive?clientid=<clientid>&key=<clientkey>
route:
...
routes:
...
- matchers:
- alertname = Watchdog
receiver: cos-alerter
group_wait: 0s
group_interval: 1m
repeat_interval: 1m
Note that group_wait
should be set to 0s
so the alert starts firing right away.
Configuring COS Alerter
Copy the file cos_alerter/config-defaults.yaml
to /etc/cos-alerter.yaml
(If running without docker) or ./cos-alerter
(if running with docker). Edit the file with the appropriate values for your environment.
Running COS Alerter
Docker
The easiest way to run COS Alerter is to use docker.
docker run -p 8080:8080 --mount type=bind,source="$(pwd)"/cos-alerter.yaml,target=/etc/cos-alerter.yaml,readonly -it ghcr.io/canonical/cos-alerter:latest
Python
You can also run cos-alerter by installing the python package.
pip install cos-alerter
cos-alerter
Development Builds
See CONTRIBUTING.md for running development builds.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file cos_alerter-0.9.0.tar.gz
.
File metadata
- Download URL: cos_alerter-0.9.0.tar.gz
- Upload date:
- Size: 66.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b3ad52ff585ccc60a823adc8a1af5681d30f2c7fb887be2fccd81b11e78993ee |
|
MD5 | c494b4c4a813c8bfced746e7ae26c96f |
|
BLAKE2b-256 | 74e4f707e6bde33e64d186f707db7dde38e666f00ebb594ed6e8a37319261ccb |
File details
Details for the file cos_alerter-0.9.0-py3-none-any.whl
.
File metadata
- Download URL: cos_alerter-0.9.0-py3-none-any.whl
- Upload date:
- Size: 63.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c9d5ba34ae8dc24b3514893ad14b00c3967bb4f61aef9ecd94614748528f8e23 |
|
MD5 | 6a2723bd0937bd400a4d9afaba74c301 |
|
BLAKE2b-256 | d2410aa41d0bf6cd7e0fbb99b368666385619b95abf16136be4771e128b63849 |