From 89e2b7e1293e4032f6ca4457326f926e44ec523c Mon Sep 17 00:00:00 2001 From: Taha Yassine Kraiem Date: Tue, 15 Nov 2022 16:30:14 +0100 Subject: [PATCH 1/4] feat(chalice): changed logs --- ee/api/chalicelib/core/sessions_exp.py | 1 + 1 file changed, 1 insertion(+) diff --git a/ee/api/chalicelib/core/sessions_exp.py b/ee/api/chalicelib/core/sessions_exp.py index 075304ab7..0b77563f9 100644 --- a/ee/api/chalicelib/core/sessions_exp.py +++ b/ee/api/chalicelib/core/sessions_exp.py @@ -294,6 +294,7 @@ def search_sessions(data: schemas.SessionsSearchPayloadSchema, project_id, user_ sessions = cur.execute(main_query) except Exception as err: print("--------- SESSIONS-CH SEARCH QUERY EXCEPTION -----------") + print(main_query) print("--------- PAYLOAD -----------") print(data.json()) print("--------------------") From b9a0fe1d948c393878818c9c464353d40b2d3db5 Mon Sep 17 00:00:00 2001 From: Taha Yassine Kraiem Date: Tue, 15 Nov 2022 18:35:01 +0100 Subject: [PATCH 2/4] chore(alerts): changed log message --- api/chalicelib/core/alerts_processor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/chalicelib/core/alerts_processor.py b/api/chalicelib/core/alerts_processor.py index f9604658b..2ed9105b2 100644 --- a/api/chalicelib/core/alerts_processor.py +++ b/api/chalicelib/core/alerts_processor.py @@ -196,7 +196,7 @@ def process(): cur.execute(query) result = cur.fetchone() if result["valid"]: - logging.info("Valid alert, notifying users, alertId:{alert['alertId']} name: {alert['name']}") + logging.info(f"Valid alert, notifying users, alertId:{alert['alertId']} name: {alert['name']}") notifications.append(generate_notification(alert, result)) except Exception as e: logging.error(f"!!!Error while running alert query for alertId:{alert['alertId']} name: {alert['name']}") From 5b663febfeef88af5dc0af0fec781a68a65b1add Mon Sep 17 00:00:00 2001 From: Taha Yassine Kraiem Date: Tue, 15 Nov 2022 18:35:20 +0100 Subject: [PATCH 3/4] chore(alerts): changed log message --- ee/api/chalicelib/core/alerts_processor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ee/api/chalicelib/core/alerts_processor.py b/ee/api/chalicelib/core/alerts_processor.py index d45d3c464..087f23a05 100644 --- a/ee/api/chalicelib/core/alerts_processor.py +++ b/ee/api/chalicelib/core/alerts_processor.py @@ -201,7 +201,7 @@ def process(): cur.execute(query) result = cur.fetchone() if result["valid"]: - logging.info("Valid alert, notifying users, alertId:{alert['alertId']} name: {alert['name']}") + logging.info(f"Valid alert, notifying users, alertId:{alert['alertId']} name: {alert['name']}") notifications.append(generate_notification(alert, result)) except Exception as e: logging.error(f"!!!Error while running alert query for alertId:{alert['alertId']} name: {alert['name']}") From 00a9cf03678c2de4d342bc2d16e332a1b4f8cd25 Mon Sep 17 00:00:00 2001 From: Taha Yassine Kraiem Date: Tue, 15 Nov 2022 18:36:45 +0100 Subject: [PATCH 4/4] chore(alerts): changed batch slack notify --- api/chalicelib/core/collaboration_slack.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/api/chalicelib/core/collaboration_slack.py b/api/chalicelib/core/collaboration_slack.py index 15f090f5d..5e7797430 100644 --- a/api/chalicelib/core/collaboration_slack.py +++ b/api/chalicelib/core/collaboration_slack.py @@ -99,7 +99,8 @@ class Slack: url=integration["endpoint"], json={"attachments": attachments[i:i + 100]}) if r.status_code != 200: - print("!!!! something went wrong") + print("!!!! something went wrong while sending to:") + print(integration) print(r) print(r.text)