diff options
| author | Robusta Runner <aantny@gmail.com> | 2024-06-14 08:18:14 +0300 |
|---|---|---|
| committer | Robusta Runner <aantny@gmail.com> | 2024-06-14 08:18:14 +0300 |
| commit | 24af7f551fc72e5d801721936f6f49f87f57ee6c (patch) | |
| tree | 219eaaa9d13d1df1242908b7db32666c6566771e /robusta_krr | |
| parent | 73eb5f3a7f1d284695fbe431985fbe674fad71c7 (diff) | |
Bug fix - thank you @deutschj
See https://github.com/robusta-dev/krr/pull/266#issuecomment-2124477234
Diffstat (limited to 'robusta_krr')
| -rw-r--r-- | robusta_krr/core/integrations/prometheus/cluster_loader/__init__.py | 6 |
1 files 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 5c88dc7..3cc6b04 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 @@ class PrometheusClusterLoader(BaseClusterLoader): 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: |
