diff options
| author | avi robusta <avi@robusta.dev> | 2023-05-29 11:37:33 +0300 |
|---|---|---|
| committer | avi robusta <avi@robusta.dev> | 2023-05-29 11:37:33 +0300 |
| commit | 2f1729852028f67ceecd0f692b5b25683fbcfd9e (patch) | |
| tree | a8b3f7b7405b31460fe8c9dbf6f66213cb095077 | |
| parent | 110da668bee9f87e0f98a0e41ef32dee4984dddf (diff) | |
Fixed prometheus error
| -rw-r--r-- | robusta_krr/core/integrations/prometheus/loader.py | 5 |
1 files 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}]', |
