From 3901791a6edb257e72dd04f658d574caca2b5620 Mon Sep 17 00:00:00 2001 From: Rune Juhl Jacobsen Date: Sun, 19 Feb 2023 21:52:36 +0100 Subject: [PATCH] debug --- grafana_webhook_to_matrix.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/grafana_webhook_to_matrix.py b/grafana_webhook_to_matrix.py index 6331621..7ba72df 100644 --- a/grafana_webhook_to_matrix.py +++ b/grafana_webhook_to_matrix.py @@ -3,15 +3,13 @@ from aiohttp import web from datetime import datetime import os - homeserver = os.environ['MATRIX_HOMESERVER'] access_token = os.environ['MATRIX_ACCESS_TOKEN'] room = os.environ['MATRIX_ROOM'] - - _last_timestamp = 0 _counter = 0 + def unique_number(): global _last_timestamp global _counter @@ -43,6 +41,7 @@ async def handle_alert(request): body = await request.json() title = body['title'] status = body['status'] + print(body) await send_message(f'[{status}] {title}') return web.Response(text='Ok') @@ -54,4 +53,5 @@ app.add_routes([ if __name__ == '__main__': + print('grafana_webhook_to_matrix.py starting') web.run_app(app, host='0.0.0.0', port=8003)