fix handling of missing prometheus endpoint
This commit is contained in:
parent
ea49b001be
commit
82bd48a754
@ -50,11 +50,15 @@ def set_up_probing_webserver():
|
|||||||
try:
|
try:
|
||||||
resp = requests.get(f"{CONFIG.rabbitmq.callback.analysis_endpoint}/prometheus")
|
resp = requests.get(f"{CONFIG.rabbitmq.callback.analysis_endpoint}/prometheus")
|
||||||
resp.raise_for_status()
|
resp.raise_for_status()
|
||||||
return resp.text
|
except ConnectionError:
|
||||||
except Exception as err:
|
return ""
|
||||||
if not informed_about_missing_prometheus_endpoint:
|
except requests.exceptions.HTTPError as err:
|
||||||
logger.warning(f"Got no metrics from analysis prometheus endpoint: {err}")
|
if resp.status_code == 404:
|
||||||
informed_about_missing_prometheus_endpoint = True
|
if not informed_about_missing_prometheus_endpoint:
|
||||||
return resp
|
logger.warning(f"Got no metrics from analysis prometheus endpoint: {err}")
|
||||||
|
informed_about_missing_prometheus_endpoint = True
|
||||||
|
else:
|
||||||
|
raise err
|
||||||
|
return resp.text
|
||||||
|
|
||||||
return app
|
return app
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user