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:
|
||||
resp = requests.get(f"{CONFIG.rabbitmq.callback.analysis_endpoint}/prometheus")
|
||||
resp.raise_for_status()
|
||||
return resp.text
|
||||
except Exception as err:
|
||||
if not informed_about_missing_prometheus_endpoint:
|
||||
logger.warning(f"Got no metrics from analysis prometheus endpoint: {err}")
|
||||
informed_about_missing_prometheus_endpoint = True
|
||||
return resp
|
||||
except ConnectionError:
|
||||
return ""
|
||||
except requests.exceptions.HTTPError as err:
|
||||
if resp.status_code == 404:
|
||||
if not informed_about_missing_prometheus_endpoint:
|
||||
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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user