Skip to main content

COS Alerter

Push to Main Release Snap Discourse Status

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.

Release files for cos-alerter 0.10.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cos-alerter 0.10.0
File Size Uploaded
cos_alerter-0.10.0.tar.gz 70.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for cos-alerter 0.10.0
File Interpreter ABI Platform
cos_alerter-0.10.0-py3-none-any.whl Python 3 none any Details

Total release size: 136.1 kB

Release files / cos_alerter-0.10.0.tar.gz

Download URL cos_alerter-0.10.0.tar.gz
Size 70.2 kB
Tags Source
SHA-256 checksum
How to use checksums
b65b3f4ad7a0e27db8667007b10f0c29ad65d183486712214e42420cace30303
BLAKE2b-256 checksum
How to use checksums
41d00955c48eb71b608f7974b6ae8b094087ae2e41f4f24ab4fd0aa4215d19bb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 24, 2026.

Transparency log

Release files / cos_alerter-0.10.0-py3-none-any.whl

Download URL cos_alerter-0.10.0-py3-none-any.whl
Size 65.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3c3e7c6f31e8de4f29273dfc3f7388904e9db486820e6130fce97a90fde96f9f
BLAKE2b-256 checksum
How to use checksums
2fa14b13796e9b3eb71f3654ed314a4dd69e8b86501f42cd30b9583308e657c0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 24, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.10.0 This release

2 release files

0.9.0

2 release files

0.8.0

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page