mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2024-11-22 04:01:27 +00:00
chore: Also show a query when prometheus fails
This commit is contained in:
parent
021208a4d6
commit
60ce3b773d
|
@ -70,7 +70,7 @@ class MonitoringQueries:
|
||||||
)
|
)
|
||||||
if response.status_code != 200:
|
if response.status_code != 200:
|
||||||
return MonitoringQueryError(
|
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()
|
json = response.json()
|
||||||
if result_type and json["data"]["resultType"] != result_type:
|
if result_type and json["data"]["resultType"] != result_type:
|
||||||
|
@ -96,7 +96,7 @@ class MonitoringQueries:
|
||||||
)
|
)
|
||||||
if response.status_code != 200:
|
if response.status_code != 200:
|
||||||
return MonitoringQueryError(
|
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()
|
json = response.json()
|
||||||
if result_type and json["data"]["resultType"] != result_type:
|
if result_type and json["data"]["resultType"] != result_type:
|
||||||
|
|
Loading…
Reference in a new issue