From 24af7f551fc72e5d801721936f6f49f87f57ee6c Mon Sep 17 00:00:00 2001 From: Robusta Runner Date: Fri, 14 Jun 2024 08:18:14 +0300 Subject: [PATCH] Bug fix - thank you @deutschj See https://github.com/robusta-dev/krr/pull/266#issuecomment-2124477234 --- .../core/integrations/prometheus/cluster_loader/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/robusta_krr/core/integrations/prometheus/cluster_loader/__init__.py b/robusta_krr/core/integrations/prometheus/cluster_loader/__init__.py index 5c88dc7b..3cc6b04f 100644 --- a/robusta_krr/core/integrations/prometheus/cluster_loader/__init__.py +++ b/robusta_krr/core/integrations/prometheus/cluster_loader/__init__.py @@ -37,20 +37,20 @@ def __init__(self) -> None: self.prometheus.connect(settings.prometheus_url) async def list_clusters(self) -> Optional[list[str]]: - if settings.prometheus_cluster_label is None: + if settings.prometheus_label is None: logger.info("Assuming that Prometheus contains only one cluster.") logger.info("If you have multiple clusters in Prometheus, please provide the `-l` flag.") return None clusters = await self.prometheus.loader.query( f""" - avg by({settings.prometheus_cluster_label}) ( + avg by({settings.prometheus_label}) ( kube_pod_container_resource_limits ) """ ) - return [cluster["metric"][settings.prometheus_cluster_label] for cluster in clusters] + return [cluster["metric"][settings.prometheus_label] for cluster in clusters] @cache def get_workload_loader(self, cluster: str) -> PrometheusWorkloadLoader: