summaryrefslogtreecommitdiff
path: root/robusta_krr
diff options
context:
space:
mode:
authorPavel Zhukov <33721692+LeaveMyYard@users.noreply.github.com>2023-09-05 13:15:13 +0300
committerGitHub <noreply@github.com>2023-09-05 13:15:13 +0300
commit88a8c3d2a7e7f358280a641b07acb43ec825ef69 (patch)
tree7e3cc7da7de801cb13c82c50bad4c13703092125 /robusta_krr
parentd820dd95ee592c876454a1dfb3db019eeab7c9b9 (diff)
parentf55a3d5e9d82bee64c7baa5d0b8f41a730b325ff (diff)
Merge pull request #142 from robusta-dev/eks_step_fix
change minimum duration for eks
Diffstat (limited to 'robusta_krr')
-rw-r--r--robusta_krr/core/runner.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/robusta_krr/core/runner.py b/robusta_krr/core/runner.py
index 659e16f..9b435bd 100644
--- a/robusta_krr/core/runner.py
+++ b/robusta_krr/core/runner.py
@@ -30,7 +30,7 @@ class Runner(Configurable):
self._metrics_service_loaders: dict[Optional[str], Union[PrometheusMetricsLoader, Exception]] = {}
self._metrics_service_loaders_error_logged: set[Exception] = set()
self._strategy = self.config.create_strategy()
-
+
# This executor will be running calculations for recommendations
self._executor = ThreadPoolExecutor(self.config.max_workers)
@@ -206,6 +206,13 @@ class Runner(Configurable):
return
try:
+ # eks has a lower step limit than other types of prometheus, it will throw an error
+ step_count = self._strategy.settings.history_duration * 60 / self._strategy.settings.timeframe_duration
+ if self.config.eks_managed_prom and step_count > 11000:
+ min_step = self._strategy.settings.history_duration * 60 / 10000
+ self.warning(f"The timeframe duration provided is insufficient and will be overridden with {min_step}. Kindly adjust --timeframe_duration to a value equal to or greater than {min_step}.")
+ self._strategy.settings.timeframe_duration = min_step
+
result = await self._collect_result()
self._process_result(result)
except ClusterNotSpecifiedException as e: