prometheus-xmpp-alerts
prometheus-xmpp-alerts copied to clipboard
support OMEMO
It would be great to support OMEMO. This depends on support in slixmpp: https://lab.louiz.org/poezio/slixmpp/merge_requests/1
Hello, added omemo support here https://github.com/ichthyx/prometheus-xmpp-alerts I'll do a pr when I have time
@ichthyx: Any news on it? :)
It's on my todo list but for now I lack of time sorry. If you in a hurry, you can get a working version in some branch, but code was not perfect.
@jelmer is master supposed to work?
I have a bunch of error like
help=argparse.HIDDEN)
^^^^^^^^^^^^^^^
AttributeError: module 'argparse' has no attribute 'HIDDEN'
UnboundLocalError: cannot access local variable 'text' where it is not associated with a value
in render_alert
and recipients bugs user@domain become 'u'
btw here an example with the new omemo plugin from Syndace
https://github.com/ichthyx/prometheus-xmpp-alerts/tree/omemo
Yeah, not sure how that regressed. I've fixed it up and added some tests for the argument parsing.
btw here an example with the new omemo plugin from [Syndace] (https://github.com/Syndace/slixmpp-omemo)
https://github.com/ichthyx/prometheus-xmpp-alerts/tree/omemo
Neat!
@jelmer with latest master if curl http://127.0.0.1:9199/test
Traceback (most recent call last):
File "/home/user/DEV/xmppprom/venv/lib/python3.12/site-packages/aiohttp/web_protocol.py", line 462, in _handle_request
resp = await request_handler(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/user/DEV/xmppprom/venv/lib/python3.12/site-packages/aiohttp/web_app.py", line 537, in _handle
resp = await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/home/user/DEV/xmppprom/prometheus-xmpp-alerts/prometheus_xmpp/__main__.py", line 249, in serve_test
text, html = await render_alert(
^^^^^^^^^^^^^^^^^^^
File "/home/user/DEV/xmppprom/prometheus-xmpp-alerts/prometheus_xmpp/__main__.py", line 283, in render_alert
return text, html
^^^^
UnboundLocalError: cannot access local variable 'html' where it is not associated with a value
config is
# HTML message template as jinja2:
# html_template: |
# <strong>{{ status.upper() }}</strong>: <i>{{ labels.alertname }}</i>
# {% if labels.host or labels.instance %} at {{ labels.host or labels.instance }}{% endif %}
# {% if annotations.message %}<br/>{{ annotations.message.replace("\n", "<br/>") }}{% endif %}
# {% if annotations.description %}<br/>{{ annotations.description }}{% endif %}
# <br/><a href="{{ generatorURL }}">Alert link</a>
# Text message template as jinja2; defaults to html_template with tags stripped.
text_template: |
{{ status.upper() }}: *{{ labels.alertname }}* at {{ labels.host or labels.instance }}:\
{{ annotations.message }}. {{ generatorURL }}
(for those following just this issue, that last bug is now fixed in master)