Update Prometheus query function to include timeout parameter
Some checks failed
CI / ci (push) Has been cancelled

- Added a timeout parameter to the requests.get call in the query_prometheus function to enhance reliability and prevent hanging requests.
This commit is contained in:
2026-02-07 18:03:55 +03:00
parent 2a0e0c216a
commit 876bfa9d2e

View File

@@ -29,7 +29,7 @@ def query_prometheus(query: str) -> str | list[str]:
params = { params = {
"query": query, "query": query,
} }
response = requests.get(url=url, params=params) response = requests.get(url=url, params=params, timeout=CHECK_TIMEOUT)
response.raise_for_status() response.raise_for_status()
result = response.json()["data"]["result"] result = response.json()["data"]["result"]
if len(result) > 1: if len(result) > 1: