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 c628de7a..4b673094 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 @@ -190,6 +190,7 @@ async def load_pods(self, object: K8sObjectData, period: datetime.timedelta) -> }}[{period_literal}] """ ) + replicasets = replicasets["result"] pod_owners = [replicaset["metric"]["replicaset"] for replicaset in replicasets] pod_owner_kind = "ReplicaSet" @@ -211,6 +212,7 @@ async def load_pods(self, object: K8sObjectData, period: datetime.timedelta) -> ) """ ) + related_pods_result = related_pods_result["result"] if related_pods_result == []: return [] @@ -231,6 +233,7 @@ async def load_pods(self, object: K8sObjectData, period: datetime.timedelta) -> }} == 1 """ ) + pods_status_result = pods_status_result["result"] current_pods_set |= {pod["metric"]["pod"] for pod in pods_status_result} del pods_status_result diff --git a/robusta_krr/strategies/simple.py b/robusta_krr/strategies/simple.py index da71531d..f7a11dfd 100644 --- a/robusta_krr/strategies/simple.py +++ b/robusta_krr/strategies/simple.py @@ -55,6 +55,8 @@ class SimpleStrategy(BaseStrategy[SimpleStrategySettings]): History: {history_duration} hours Step: {timeframe_duration} minutes + All parameters can be customized. For example: `krr simple --cpu_percentile=90 --memory_buffer_percentage=15 --history_duration=24 --timeframe_duration=0.5` + This strategy does not work with objects with HPA defined (Horizontal Pod Autoscaler). If HPA is defined for CPU or Memory, the strategy will return "?" for that resource.