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.
Security Considerations
To keep the codebase focused, COS Alerter does not natively encrypt traffic. Additionally, it does not restrict access to the dashboard to avoid providing a false sense of security. It is highly recommended to use a reverse proxy with Basic Auth and HTTPS to secure the deployment.
Alternatively, running the dashboard and the API endpoints on different IP:PORT pairs is also possible. The dashboard can listen on localhost, requiring an SSH tunnel to enforce authenticated access.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cos_alerter-0.10.0.tar.gz.
File metadata
- Download URL: cos_alerter-0.10.0.tar.gz
- Upload date:
- Size: 70.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b65b3f4ad7a0e27db8667007b10f0c29ad65d183486712214e42420cace30303
|
|
| MD5 |
b1469de2096c763de589099e7fef451e
|
|
| BLAKE2b-256 |
41d00955c48eb71b608f7974b6ae8b094087ae2e41f4f24ab4fd0aa4215d19bb
|
Provenance
The following attestation bundles were made for cos_alerter-0.10.0.tar.gz:
Publisher:
push-main.yaml on canonical/cos-alerter
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cos_alerter-0.10.0.tar.gz -
Subject digest:
b65b3f4ad7a0e27db8667007b10f0c29ad65d183486712214e42420cace30303 - Sigstore transparency entry: 1940979096
- Sigstore integration time:
-
Permalink:
canonical/cos-alerter@299c36ac538425563f99957a79a85c57f98092b6 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/canonical
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
push-main.yaml@299c36ac538425563f99957a79a85c57f98092b6 -
Trigger Event:
push
-
Statement type:
File details
Details for the file cos_alerter-0.10.0-py3-none-any.whl.
File metadata
- Download URL: cos_alerter-0.10.0-py3-none-any.whl
- Upload date:
- Size: 65.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3c3e7c6f31e8de4f29273dfc3f7388904e9db486820e6130fce97a90fde96f9f
|
|
| MD5 |
529bdd167f7db7d958662c6c380cf7d2
|
|
| BLAKE2b-256 |
2fa14b13796e9b3eb71f3654ed314a4dd69e8b86501f42cd30b9583308e657c0
|
Provenance
The following attestation bundles were made for cos_alerter-0.10.0-py3-none-any.whl:
Publisher:
push-main.yaml on canonical/cos-alerter
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cos_alerter-0.10.0-py3-none-any.whl -
Subject digest:
3c3e7c6f31e8de4f29273dfc3f7388904e9db486820e6130fce97a90fde96f9f - Sigstore transparency entry: 1940979158
- Sigstore integration time:
-
Permalink:
canonical/cos-alerter@299c36ac538425563f99957a79a85c57f98092b6 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/canonical
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
push-main.yaml@299c36ac538425563f99957a79a85c57f98092b6 -
Trigger Event:
push
-
Statement type: