From 2f1729852028f67ceecd0f692b5b25683fbcfd9e Mon Sep 17 00:00:00 2001 From: avi robusta Date: Mon, 29 May 2023 11:37:33 +0300 Subject: Fixed prometheus error --- robusta_krr/core/integrations/prometheus/loader.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/robusta_krr/core/integrations/prometheus/loader.py b/robusta_krr/core/integrations/prometheus/loader.py index 4e50626..93bc031 100644 --- a/robusta_krr/core/integrations/prometheus/loader.py +++ b/robusta_krr/core/integrations/prometheus/loader.py @@ -129,8 +129,9 @@ class PrometheusLoader(Configurable): if len(object.pods) == 0: return - - period_literal = f"{int(period.total_seconds()) // 60 // 24}d" + + days_literal = min(int(period.total_seconds()) // 60 // 24, 32) # the max can be 32 days + period_literal = f"{days_literal}d" owner = await asyncio.to_thread( self.prometheus.custom_query, query=f'kube_pod_owner{{pod="{next(iter(object.pods)).name}"}}[{period_literal}]', -- cgit v1.2.3