From c850c645643553fe88a167f0b97390755dd0f358 Mon Sep 17 00:00:00 2001 From: Kraiem Taha Yassine Date: Tue, 28 Nov 2023 14:40:19 +0100 Subject: [PATCH] fix(alerts): fixed batch-ms-teams notifications (#1720) (cherry picked from commit 2e92314cdab5f89d6080494f75e17fd3cb5135da) --- api/chalicelib/core/alerts.py | 2 +- api/chalicelib/core/alerts_processor.py | 2 +- api/run-alerts-dev.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/api/chalicelib/core/alerts.py b/api/chalicelib/core/alerts.py index d030ccf9d..a643c366b 100644 --- a/api/chalicelib/core/alerts.py +++ b/api/chalicelib/core/alerts.py @@ -193,7 +193,7 @@ def send_to_msteams_batch(notifications_list): webhookId_map[n.get("destination")]["batch"].append( { "activityTitle": n["notification"]["title"], - "activitySubtitle": f"On Project *{n['projectName']}*", + "activitySubtitle": f"On Project *{n['notification']['projectName']}*", "facts": [ { "name": "Target:", diff --git a/api/chalicelib/core/alerts_processor.py b/api/chalicelib/core/alerts_processor.py index 79c2ea8af..4bca78e81 100644 --- a/api/chalicelib/core/alerts_processor.py +++ b/api/chalicelib/core/alerts_processor.py @@ -238,7 +238,7 @@ def generate_notification(alert, result): "alertId": alert["alertId"], "tenantId": alert["tenantId"], "title": alert["name"], - "description": f"has been triggered, {alert['seriesName']} = {left} ({alert['query']['operator']} {right}).", + "description": f"{alert['seriesName']} = {left} ({alert['query']['operator']} {right}).", "buttonText": "Check metrics for more details", "buttonUrl": f"/{alert['projectId']}/metrics", "imageUrl": None, diff --git a/api/run-alerts-dev.sh b/api/run-alerts-dev.sh index 309356133..e0d1d00e8 100755 --- a/api/run-alerts-dev.sh +++ b/api/run-alerts-dev.sh @@ -1,3 +1,3 @@ #!/bin/zsh -uvicorn app_alerts:app --reload --port 8888 \ No newline at end of file +uvicorn app_alerts:app --reload --port 8888 --log-level ${S_LOGLEVEL:-warning} \ No newline at end of file