# HG changeset patch # User Kim Alvefur # Date 1626448867 -7200 # Node ID 61ce3394fe8be7a3f203c8ad9ebabb1eaeeaf6d8 # Parent ebc2c099a11bac9e716f18bb0cd0fda15c7de981 mod_pubsub_alertmanager: Add a README with initial docs diff -r ebc2c099a11b -r 61ce3394fe8b mod_pubsub_alertmanager/README.md --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mod_pubsub_alertmanager/README.md Fri Jul 16 17:21:07 2021 +0200 @@ -0,0 +1,51 @@ +--- +labels: +- 'Stage-Alpha' +summary: Alertmanager webhook receiver for pubsub +--- + +# Introduction + +This module lets +[Alertmanager](https://prometheus.io/docs/alerting/latest/alertmanager/) +publish alerts to [pubsub][doc:pubsub] via +[webhooks](https://prometheus.io/docs/alerting/latest/configuration/#webhook_config). + +# Setup + +The relevant pubsub nodes must be created and configured somehow. +Because the request IP address is used to publish, the `publisher` +affiliation should be given to the IP address Alertmanager sends +webhooks from. + +# Configuration + +On the Prosody side, apart from creating and configuring the node(s) +that will be used, configure your pubsub service like this: + +``` lua +Component "pubsub.example.com" "pubsub" +modules_enabled = { + "pubsub_alertmanager", +} + +-- optional extra settings: +alertmanager_body_template = [[ +*ALARM!* {annotations.title?Alert} is {status} +Since {startsAt}{endsAt& until {endsAt}} +Labels: {labels% + {idx}: {item}} +Annotations: {annotations% + {idx}: {item}} +]] + +alertmanager_node_template = "alerts/{alert.labels.severity}" +``` + +Available configuration options: + +`alertmanager_body_template` +: Template for the textual representation of alerts. + +`alertmanager_node_template` +: Template for the pubsub node name, defaults to `"{path?alerts}"`