From 60ce3b773d052c33e7b43aa01827e7204d7847d4 Mon Sep 17 00:00:00 2001 From: Inex Code Date: Mon, 29 Jul 2024 18:50:23 +0300 Subject: [PATCH] chore: Also show a query when prometheus fails --- selfprivacy_api/utils/monitoring.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/selfprivacy_api/utils/monitoring.py b/selfprivacy_api/utils/monitoring.py index 762e35a..630e843 100644 --- a/selfprivacy_api/utils/monitoring.py +++ b/selfprivacy_api/utils/monitoring.py @@ -70,7 +70,7 @@ class MonitoringQueries: ) if response.status_code != 200: return MonitoringQueryError( - error=f"Prometheus returned unexpected HTTP status code. Error: {response.text}" + error=f"Prometheus returned unexpected HTTP status code. Error: {response.text}. The query was {query}" ) json = response.json() if result_type and json["data"]["resultType"] != result_type: @@ -96,7 +96,7 @@ class MonitoringQueries: ) if response.status_code != 200: return MonitoringQueryError( - error=f"Prometheus returned unexpected HTTP status code. Error: {response.text}" + error=f"Prometheus returned unexpected HTTP status code. Error: {response.text}. The query was {query}" ) json = response.json() if result_type and json["data"]["resultType"] != result_type: