# HG changeset patch # User Kim Alvefur # Date 1626449664 -7200 # Node ID 622c6308d7afc1d21b9c1eed94d2c9aa4f1d0b24 # Parent 61ce3394fe8be7a3f203c8ad9ebabb1eaeeaf6d8 mod_pubsub_alertmanager: Minimal example of Prometheus and Alertmanager config diff -r 61ce3394fe8b -r 622c6308d7af mod_pubsub_alertmanager/README.md --- a/mod_pubsub_alertmanager/README.md Fri Jul 16 17:21:07 2021 +0200 +++ b/mod_pubsub_alertmanager/README.md Fri Jul 16 17:34:24 2021 +0200 @@ -20,6 +20,43 @@ # Configuration +## Prometheus + +A Prometheus `rule_files` might contain something along these lines: + +``` yaml +groups: +- name: Stuff + rules: + - alert: Down + expr: up == 0 + for: 5m + annotations: + title: 'Stuff is down!' + labels: + severity: 'critical' +``` + +## Alertmanager +On the Alertmanager site the webhook configuration may look something +like this: + +``` yaml +receivers: +- name: pubsub + webhook_configs: + - url: http://pubsub.localhost:5280/pubsub_alertmanager +``` + +And then finally some Alertmanager routes would point at that receiver: + +``` yaml +route: + receiver: pubsub +``` + +## Prosody + On the Prosody side, apart from creating and configuring the node(s) that will be used, configure your pubsub service like this: @@ -42,6 +79,8 @@ alertmanager_node_template = "alerts/{alert.labels.severity}" ``` +## All Options + Available configuration options: `alertmanager_body_template`