From 0af95a105b206d8c94068798cbce8eef6479eedb Mon Sep 17 00:00:00 2001 From: Remi Rampin Date: Tue, 8 Nov 2022 12:10:18 -0500 Subject: [PATCH] Only send title to Matrix --- grafana_webhook_to_matrix.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/grafana_webhook_to_matrix.py b/grafana_webhook_to_matrix.py index ec9b0dc..b27d68b 100644 --- a/grafana_webhook_to_matrix.py +++ b/grafana_webhook_to_matrix.py @@ -41,10 +41,9 @@ async def send_message(text): async def handle_alert(request): body = await request.json() - for alert in body['alerts']: - status = alert['status'] - name = alert['labels']['alertname'] - await send_message(f'[{status}] {name}') + title = body['title'] + status = body['status'] + await send_message(f'[{status}] {title}') return web.Response(text='Ok')