From f9385c201fb2e4e78753c07c8197e5aa3d96cdc8 Mon Sep 17 00:00:00 2001 From: andersonid Date: Mon, 6 Oct 2025 12:17:29 -0300 Subject: [PATCH] fix: correct prometheus_url to base_url in PrometheusClient health_check --- app/core/prometheus_client.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/core/prometheus_client.py b/app/core/prometheus_client.py index ea8494b..c584457 100644 --- a/app/core/prometheus_client.py +++ b/app/core/prometheus_client.py @@ -262,7 +262,7 @@ class PrometheusClient: if not self.initialized or not self.session: return { 'status': 'unhealthy', - 'prometheus_url': self.prometheus_url, + 'prometheus_url': self.base_url, 'error': 'Prometheus not initialized' } @@ -272,17 +272,17 @@ class PrometheusClient: asyncio.set_event_loop(loop) 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: return { 'status': 'healthy', - 'prometheus_url': self.prometheus_url, + 'prometheus_url': self.base_url, 'response_time': 0.1 # Placeholder } else: return { 'status': 'unhealthy', - 'prometheus_url': self.prometheus_url, + 'prometheus_url': self.base_url, 'error': f'HTTP {response.status}' } @@ -294,7 +294,7 @@ class PrometheusClient: logger.error(f"Prometheus health check failed: {e}") return { 'status': 'unhealthy', - 'prometheus_url': self.prometheus_url, + 'prometheus_url': self.base_url, 'error': str(e) }