Skip to content

Commit

Permalink
Merge pull request #142 from robusta-dev/eks_step_fix
Browse files Browse the repository at this point in the history
change minimum duration for eks
  • Loading branch information
LeaveMyYard authored Sep 5, 2023
2 parents d820dd9 + f55a3d5 commit 88a8c3d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion robusta_krr/core/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def __init__(self, config: Config) -> None:
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)

Expand Down Expand Up @@ -206,6 +206,13 @@ async def run(self) -> None:
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:
Expand Down

0 comments on commit 88a8c3d

Please sign in to comment.