mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-08 03:08:45 +00:00
Merge pull request #22523 from BerriAI/fix/lint-undefined-kwargs
Fix undefined kwargs in InFlightRequestsMiddleware
This commit is contained in:
commit
00affc01b5
1 changed files with 2 additions and 1 deletions
|
|
@ -62,13 +62,14 @@ class InFlightRequestsMiddleware:
|
|||
try:
|
||||
from prometheus_client import Gauge
|
||||
|
||||
kwargs: dict[str, Any] = {}
|
||||
if "PROMETHEUS_MULTIPROC_DIR" in os.environ:
|
||||
# livesum aggregates across all worker processes in the scrape response
|
||||
kwargs["multiprocess_mode"] = "livesum"
|
||||
InFlightRequestsMiddleware._gauge = Gauge(
|
||||
"litellm_in_flight_requests",
|
||||
"Number of HTTP requests currently in-flight on this uvicorn worker",
|
||||
**kwargs, # type: ignore[arg-type]
|
||||
**kwargs,
|
||||
)
|
||||
except Exception:
|
||||
InFlightRequestsMiddleware._gauge = None
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue