From 876bfa9d2e257d845dcda8b0e279f9686c68be3b Mon Sep 17 00:00:00 2001 From: Nikolay Tatarinov Date: Sat, 7 Feb 2026 18:03:55 +0300 Subject: [PATCH] Update Prometheus query function to include timeout parameter - Added a timeout parameter to the requests.get call in the query_prometheus function to enhance reliability and prevent hanging requests. --- dashboard/prometheus_utils/query.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dashboard/prometheus_utils/query.py b/dashboard/prometheus_utils/query.py index 80be3af..0a5d093 100644 --- a/dashboard/prometheus_utils/query.py +++ b/dashboard/prometheus_utils/query.py @@ -29,7 +29,7 @@ def query_prometheus(query: str) -> str | list[str]: params = { "query": query, } - response = requests.get(url=url, params=params) + response = requests.get(url=url, params=params, timeout=CHECK_TIMEOUT) response.raise_for_status() result = response.json()["data"]["result"] if len(result) > 1: