From c44f2869c9790a59528305099cf26960c7972dc7 Mon Sep 17 00:00:00 2001 From: lambert0312 Date: Mon, 21 Apr 2025 15:35:38 +0800 Subject: [PATCH] Modify metrics service endpoint (#3443) --- python/sglang/srt/utils.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/python/sglang/srt/utils.py b/python/sglang/srt/utils.py index 8fb000a56..4151968dd 100644 --- a/python/sglang/srt/utils.py +++ b/python/sglang/srt/utils.py @@ -784,6 +784,8 @@ def add_api_key_middleware(app, api_key: str): return await call_next(request) if request.url.path.startswith("/health"): return await call_next(request) + if request.url.path.startswith("/metrics"): + return await call_next(request) if request.headers.get("Authorization") != "Bearer " + api_key: return ORJSONResponse(content={"error": "Unauthorized"}, status_code=401) return await call_next(request)