From 32026a62720c7ac09cc0906eea83338eff039325 Mon Sep 17 00:00:00 2001 From: 72004 Date: Sun, 11 Oct 2026 18:55:18 +0500 Subject: [PATCH] fix(prometheus): return early on team lookup failure instead of rebinding team_info --- litellm/integrations/prometheus.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/litellm/integrations/prometheus.py b/litellm/integrations/prometheus.py index 50ff8cd6f32..cf6ddb6a8eb 100644 --- a/litellm/integrations/prometheus.py +++ b/litellm/integrations/prometheus.py @@ -4230,15 +4230,20 @@ class PrometheusLogger(CustomLogger): max_budget=max_budget if max_budget is not None else carried.max_budget, budget_reset_at=carried.budget_reset_at, ) - team_info: LiteLLM_TeamTable | None = None try: - team_info = await get_team_object( + team_info: Final = await get_team_object( team_id=team_id, prisma_client=prisma_client, user_api_key_cache=user_api_key_cache, ) except Exception as e: verbose_logger.debug("[Non-Blocking] Prometheus: Error getting team info: %s", e) + return LiteLLM_TeamTable( + team_id=team_id, + team_alias=team_alias, + spend=_total_team_spend, + max_budget=max_budget, + ) # metadata spend of None means "unknown", not "nothing spent" -- fall back to the DB value _base_spend: Final = (