prometheus-xmpp-alerts
A simple web hook that forwards prometheus alerts over XMPP.
Usage
To use, configure a web hook in alertmanager. E.g.:
receivers:
- name: 'jelmer-xmpp'
webhook_configs:
- url: 'http://192.168.2.1:9199/alert'
Edit the configuration file (defaults to /etc/prometheus/xmpp-alerts.yml):
jid: 'alertmanager@example.com'
password: 'PASSWORD'
# Alternatively, set a 'password_command' that should write a password to
# stdout
# password_command: 'pass show xmpp-alertmanager'
to_jid: 'jelmer@example.com'
listen_address: '192.168.2.1'
listen_port: 9199
# Text message template as jinja2; defaults to html_template with tags stripped (optional)
text_template: |
{{ status.upper() }}: *{{ labels.alertname }}* at {{ labels.host or labels.instance }}:\
{{ annotations.message }}. {{ generatorURL }}
You can also set the following environment variables instead:
-
XMPP_ID- XMPP JID -
XMPP_PASS- Password -
XMPP_RECIPIENTS- comma-separated list of recipients -
XMPP_AMTOOL_ALLOWED- comma-separated list of users (optional) -
WEBHOOK_HOST- Address to listen on (optional) -
WEBHOOK_PORT- Port to listen on (optional) -
TEXT_TEMPLATE- Template for text messages (see above, optional) -
HTML_TEMPALTE- Template for HTML messages (see above, optional)
And run the web hook::
$ python3 -m prometheus_xmpp --config=/etc/prometheus/xmpp-alerts.yaml
If you have amtool set up,
then you can also allow users to see existing alerts and manage silences.
Set the amtool_allowed option to JIDs that are allowed to use amtool.
Docker file
You can build your own docker images using the Dockerfile in this directory, or
use ghcr.io/jelmer/prometheus-xmpp-alerts. Provide your configuration in
/config.yaml or through environment variables.
Message Format
The default message format looks something like this:
FIRING: AlertName at somehost: Alert Summary. https://prometheus.example.com/expr?...
The text_template option in the configuration can be used to customize the
format, using jinja2.
Testing
The web hook can be accessed on three paths:
/alert: used by Prometheus to deliver alerts, expects POST requests with JSON body/test: delivers a test message/metrics: exposes statistics about number of alerts received
Release files for prometheus-xmpp-alerts 0.6.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| prometheus_xmpp_alerts-0.6.0.tar.gz | 12.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| prometheus_xmpp_alerts-0.6.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 26.2 kB
Release files / prometheus_xmpp_alerts-0.6.0.tar.gz
| Download URL | prometheus_xmpp_alerts-0.6.0.tar.gz |
|---|---|
| Size | 12.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ed0fde7d3e1b1dd64cb3e8fc485654c43e527f4c60297783d17d27d35982ae2e
|
|
BLAKE2b-256 checksum How to use checksums |
f41420b0d0283804c4baa9ad96694c0602feb5b4d2600325a1bf40523d023e90
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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 Sep 13, 2025.
Transparency logRelease files / prometheus_xmpp_alerts-0.6.0-py3-none-any.whl
| Download URL | prometheus_xmpp_alerts-0.6.0-py3-none-any.whl |
|---|---|
| Size | 13.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
74ac994758917ec29a410b425900643c281668b7e2641ef2d0368b029c43e888
|
|
BLAKE2b-256 checksum How to use checksums |
d0f678e1d43ed4382ebaa4d0127197f4146c4a5b16de75100498b76a5c504097
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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 Sep 13, 2025.
Transparency log