mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 18:54:30 +00:00
allow setting PROMETHEUS_SELECTED_INSTANCE
This commit is contained in:
parent
e46009f3d2
commit
dd9be6f160
1 changed files with 4 additions and 0 deletions
|
@ -57,6 +57,10 @@ async def get_fallback_metric_from_prometheus():
|
|||
metric_values = result["values"]
|
||||
most_recent_value = metric_values[0]
|
||||
|
||||
if PROMETHEUS_SELECTED_INSTANCE is not None:
|
||||
if metric.get("instance") != PROMETHEUS_SELECTED_INSTANCE:
|
||||
continue
|
||||
|
||||
value = int(float(most_recent_value[1])) # Convert value to integer
|
||||
primary_model = metric.get("primary_model", "Unknown")
|
||||
fallback_model = metric.get("fallback_model", "Unknown")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue