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 44bbadb1..c93cf35e 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 @@ -1,5 +1,6 @@ import asyncio import logging +import os from concurrent.futures import ThreadPoolExecutor from datetime import datetime, timedelta from typing import Iterable, List, Optional, Dict, Any @@ -314,7 +315,8 @@ async def load_pods(self, object: K8sObjectData, period: timedelta) -> list[PodD pod_owner_kind = object.kind related_pods_result = [] - for owner_group in batched(pod_owners, 10): + batch_size = int(os.environ.get("KRR_OWNER_BATCH_SIZE", 100)) + for owner_group in batched(pod_owners, batch_size): owners_regex = "|".join(owner_group) related_pods_result_item = await self.query( f"""