From 7527ad6d22e27be3afde934d6a2859735d4599d4 Mon Sep 17 00:00:00 2001 From: Chico Venancio Date: Fri, 8 Dec 2023 11:26:10 -0300 Subject: [PATCH] feat(VictoriaMetricsDiscovery): set correct url for cluster version --- .../metrics_service/victoria_metrics_service.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/robusta_krr/core/integrations/prometheus/metrics_service/victoria_metrics_service.py b/robusta_krr/core/integrations/prometheus/metrics_service/victoria_metrics_service.py index a0f10100..12aaace6 100644 --- a/robusta_krr/core/integrations/prometheus/metrics_service/victoria_metrics_service.py +++ b/robusta_krr/core/integrations/prometheus/metrics_service/victoria_metrics_service.py @@ -17,14 +17,21 @@ def find_metrics_url(self, *, api_client: Optional[ApiClient] = None) -> Optiona Returns: Optional[str]: The discovered Victoria Metrics URL, or None if not found. """ - return super().find_url( + url = super().find_url( selectors=[ "app.kubernetes.io/name=vmsingle", "app.kubernetes.io/name=victoria-metrics-single", - "app.kubernetes.io/name=vmselect", - "app=vmselect", ] ) + if url is None: + url = super().find_url( + selectors=[ + "app.kubernetes.io/name=vmselect", + "app=vmselect", + ] + ) + url = f"{url}/select/0/prometheus/" + return url class VictoriaMetricsService(PrometheusMetricsService):