From 554489ea184ee43482d51f959e2769ecf1c58d2d Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Thu, 23 Jan 2025 09:05:14 -0800 Subject: [PATCH] Revert "set litellm_team_budget_reset_at_metric" This reverts commit 39d959d72a7d8cb2d8b1e74c5e5c7d2f9655045a. --- litellm/integrations/prometheus.py | 35 +++++++----------------------- 1 file changed, 8 insertions(+), 27 deletions(-) diff --git a/litellm/integrations/prometheus.py b/litellm/integrations/prometheus.py index f31b90aebe8..908667571c8 100644 --- a/litellm/integrations/prometheus.py +++ b/litellm/integrations/prometheus.py @@ -139,27 +139,7 @@ class PrometheusLogger(CustomLogger): self.litellm_remaining_team_budget_metric = Gauge( "litellm_remaining_team_budget_metric", "Remaining budget for team", - labelnames=PrometheusMetricLabels.get_labels( - label_name="litellm_remaining_team_budget_metric" - ), - ) - - # Max Budget for Team - self.litellm_team_max_budget_metric = Gauge( - "litellm_team_max_budget_metric", - "Maximum budget set for team", - labelnames=PrometheusMetricLabels.get_labels( - label_name="litellm_team_max_budget_metric" - ), - ) - - # Team Budget Reset At - self.litellm_team_budget_reset_at_metric = Gauge( - "litellm_team_budget_reset_at_metric", - "Time when the team budget will be reset", - labelnames=PrometheusMetricLabels.get_labels( - label_name="litellm_team_budget_reset_at_metric" - ), + labelnames=["team_id", "team_alias"], ) # Remaining Budget for API Key @@ -169,6 +149,13 @@ class PrometheusLogger(CustomLogger): labelnames=["hashed_api_key", "api_key_alias"], ) + # Max Budget for Team + self.litellm_team_max_budget_metric = Gauge( + "litellm_team_max_budget_metric", + "Maximum budget set for team", + labelnames=["team_id", "team_alias"], + ) + # Max Budget for API Key self.litellm_api_key_max_budget_metric = Gauge( "litellm_api_key_max_budget_metric", @@ -1384,12 +1371,6 @@ class PrometheusLogger(CustomLogger): ) ) - if team.budget_reset_at is not None: - self.litellm_team_budget_reset_at_metric.labels( - team.team_id, - team.team_alias or "", - ).set(team.budget_reset_at.timestamp()) - def prometheus_label_factory( supported_enum_labels: List[str],