mirror of
https://github.com/tiennm99/litellm.git
synced 2026-08-17 04:26:20 +00:00
allow setting PROMETHEUS_SELECTED_INSTANCE
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user