mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 10:44:24 +00:00
build: merge branch
This commit is contained in:
parent
f63cf00306
commit
4418e6dd14
9 changed files with 301 additions and 56 deletions
|
@ -1560,10 +1560,18 @@ class PrometheusLogger(CustomLogger):
|
|||
- Max Budget
|
||||
- Budget Reset At
|
||||
"""
|
||||
self.litellm_remaining_team_budget_metric.labels(
|
||||
team.team_id,
|
||||
team.team_alias or "",
|
||||
).set(
|
||||
enum_values = UserAPIKeyLabelValues(
|
||||
team=team.team_id,
|
||||
team_alias=team.team_alias or "",
|
||||
)
|
||||
|
||||
_labels = prometheus_label_factory(
|
||||
supported_enum_labels=PrometheusMetricLabels.get_labels(
|
||||
label_name="litellm_remaining_team_budget_metric"
|
||||
),
|
||||
enum_values=enum_values,
|
||||
)
|
||||
self.litellm_remaining_team_budget_metric.labels(**_labels).set(
|
||||
self._safe_get_remaining_budget(
|
||||
max_budget=team.max_budget,
|
||||
spend=team.spend,
|
||||
|
@ -1571,16 +1579,22 @@ class PrometheusLogger(CustomLogger):
|
|||
)
|
||||
|
||||
if team.max_budget is not None:
|
||||
self.litellm_team_max_budget_metric.labels(
|
||||
team.team_id,
|
||||
team.team_alias or "",
|
||||
).set(team.max_budget)
|
||||
_labels = prometheus_label_factory(
|
||||
supported_enum_labels=PrometheusMetricLabels.get_labels(
|
||||
label_name="litellm_team_max_budget_metric"
|
||||
),
|
||||
enum_values=enum_values,
|
||||
)
|
||||
self.litellm_team_max_budget_metric.labels(**_labels).set(team.max_budget)
|
||||
|
||||
if team.budget_reset_at is not None:
|
||||
self.litellm_team_budget_remaining_hours_metric.labels(
|
||||
team.team_id,
|
||||
team.team_alias or "",
|
||||
).set(
|
||||
_labels = prometheus_label_factory(
|
||||
supported_enum_labels=PrometheusMetricLabels.get_labels(
|
||||
label_name="litellm_team_budget_remaining_hours_metric"
|
||||
),
|
||||
enum_values=enum_values,
|
||||
)
|
||||
self.litellm_team_budget_remaining_hours_metric.labels(**_labels).set(
|
||||
self._get_remaining_hours_for_budget_reset(
|
||||
budget_reset_at=team.budget_reset_at
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue