Skip to main content

COS Alerter

Release 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.

Metadata

Release files for cos-alerter 1.0.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 1.0.0
File Size Uploaded Provenance Actions
cos_alerter-1.0.0.tar.gz 72.5 kB With provenance Details for cos_alerter-1.0.0.tar.gz

Built distribution (wheel)

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

Total release size: 139.6 kB

Release files / cos_alerter-1.0.0.tar.gz

Download URL cos_alerter-1.0.0.tar.gz
Size 72.5 kB
Tags Source
SHA-256 checksum
How to use checksums
328d0a947e6a7e85c65e1899d32938758225bcbc2987bcfbfebf136f9f6bf27e
BLAKE2b-256 checksum
How to use checksums
cf39636ac48ebb8dfb506ba95f1647ebf07aa2bff486c3ad135e2f1de64cd7cb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 10, 2026.

Transparency log

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

Download URL cos_alerter-1.0.0-py3-none-any.whl
Size 67.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
071f10a8a4a189be63a406678f4e79562dc89455bc80abf8a834cd719c7b1494
BLAKE2b-256 checksum
How to use checksums
a09744f73a81e2bd1f38f09a0f54b77853bcd97b3199cb71dbfdd70ca5f68c9c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 10, 2026.

Transparency log

Security for cos-alerter 1.0.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for cos_alerter-1.0.0.tar.gz

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 Nov 10, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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