diff --git a/robusta_krr/core/integrations/prometheus/metrics_service/prometheus_metrics_service.py b/robusta_krr/core/integrations/prometheus/metrics_service/prometheus_metrics_service.py index 83fcf386..31fe0c0e 100644 --- a/robusta_krr/core/integrations/prometheus/metrics_service/prometheus_metrics_service.py +++ b/robusta_krr/core/integrations/prometheus/metrics_service/prometheus_metrics_service.py @@ -178,6 +178,8 @@ async def gather_data( self.debug(f"Gathering data for {object} and {resource}") MetricLoaderType = BaseMetricLoader.get_by_resource(resource, self.config.strategy) + await self.add_historic_pods(object, period) + metric_loader = MetricLoaderType(self.config, self.prometheus, self.executor) return await metric_loader.load_data(object, period, step, self.name()) diff --git a/robusta_krr/core/runner.py b/robusta_krr/core/runner.py index 890e19d4..3cdf7b96 100644 --- a/robusta_krr/core/runner.py +++ b/robusta_krr/core/runner.py @@ -154,7 +154,7 @@ async def _gather_objects_recommendations( async def _collect_result(self) -> Result: clusters = await self._k8s_loader.list_clusters() - if len(clusters) > 1 and self.config.prometheus_url: + if clusters and len(clusters) > 1 and self.config.prometheus_url: # this can only happen for multi-cluster querying a single centeralized prometheus # In this scenario we dont yet support determining which metrics belong to which cluster so the reccomendation can be incorrect raise ClusterNotSpecifiedException(