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'
# Connect to a specific XMPP server rather than looking it up via DNS SRV
# (optional, xmpp_port defaults to 5222)
# xmpp_host: 'xmpp.example.com'
# xmpp_port: 5222
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_HOST- XMPP server to connect to, bypassing DNS SRV lookup (optional) -
XMPP_PORT- XMPP server port, defaults to 5222 (optional) -
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_TEMPLATE- 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
Metadata
Release files for prometheus-xmpp-alerts 0.7.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 | Provenance | Actions |
|---|---|---|---|---|
| prometheus_xmpp_alerts-0.7.0.tar.gz | 15.7 kB | With provenance | Details for prometheus_xmpp_alerts-0.7.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| prometheus_xmpp_alerts-0.7.0-py3-none-any.whl | Python 3 | none | any | Details for prometheus_xmpp_alerts-0.7.0-py3-none-any.whl |
Total release size: 29.3 kB
Release files / prometheus_xmpp_alerts-0.7.0.tar.gz
| Download URL | prometheus_xmpp_alerts-0.7.0.tar.gz |
|---|---|
| Size | 15.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5d300df48e694ae7403e2c79b375c85851c35ff416d7afb9d5c485a8abbb7c8c
|
|
BLAKE2b-256 checksum How to use checksums |
e44c324cd2816b24a6bbbe4468e8b31db117bc7c4ae91ebfcdd40ab524bdd8bb
|
| 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 Oct 27, 2026.
Transparency logRelease files / prometheus_xmpp_alerts-0.7.0-py3-none-any.whl
| Download URL | prometheus_xmpp_alerts-0.7.0-py3-none-any.whl |
|---|---|
| Size | 13.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ecb99739ea96df7d4ca2dbf77195116f183536159b0841ca6593ffaca27943d9
|
|
BLAKE2b-256 checksum How to use checksums |
bde9aae8ef15d1c8e2e0ba10d443c9ff390560060deb9590eb9240f16cca30e9
|
| 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 Oct 27, 2026.
Transparency logSecurity for prometheus-xmpp-alerts 0.7.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.
Attestation for prometheus_xmpp_alerts-0.7.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 Oct 27, 2026.
Transparency logA 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.