fix: correct prometheus_url to base_url in PrometheusClient health_check
This commit is contained in:
@@ -262,7 +262,7 @@ class PrometheusClient:
|
|||||||
if not self.initialized or not self.session:
|
if not self.initialized or not self.session:
|
||||||
return {
|
return {
|
||||||
'status': 'unhealthy',
|
'status': 'unhealthy',
|
||||||
'prometheus_url': self.prometheus_url,
|
'prometheus_url': self.base_url,
|
||||||
'error': 'Prometheus not initialized'
|
'error': 'Prometheus not initialized'
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -272,17 +272,17 @@ class PrometheusClient:
|
|||||||
asyncio.set_event_loop(loop)
|
asyncio.set_event_loop(loop)
|
||||||
|
|
||||||
async def _health_check():
|
async def _health_check():
|
||||||
async with self.session.get(f"{self.prometheus_url}/api/v1/status/config") as response:
|
async with self.session.get(f"{self.base_url}/api/v1/status/config") as response:
|
||||||
if response.status == 200:
|
if response.status == 200:
|
||||||
return {
|
return {
|
||||||
'status': 'healthy',
|
'status': 'healthy',
|
||||||
'prometheus_url': self.prometheus_url,
|
'prometheus_url': self.base_url,
|
||||||
'response_time': 0.1 # Placeholder
|
'response_time': 0.1 # Placeholder
|
||||||
}
|
}
|
||||||
else:
|
else:
|
||||||
return {
|
return {
|
||||||
'status': 'unhealthy',
|
'status': 'unhealthy',
|
||||||
'prometheus_url': self.prometheus_url,
|
'prometheus_url': self.base_url,
|
||||||
'error': f'HTTP {response.status}'
|
'error': f'HTTP {response.status}'
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -294,7 +294,7 @@ class PrometheusClient:
|
|||||||
logger.error(f"Prometheus health check failed: {e}")
|
logger.error(f"Prometheus health check failed: {e}")
|
||||||
return {
|
return {
|
||||||
'status': 'unhealthy',
|
'status': 'unhealthy',
|
||||||
'prometheus_url': self.prometheus_url,
|
'prometheus_url': self.base_url,
|
||||||
'error': str(e)
|
'error': str(e)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user