Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
change
sglang
Commits
c44f2869
Unverified
Commit
c44f2869
authored
Apr 21, 2025
by
lambert0312
Committed by
GitHub
Apr 21, 2025
Browse files
Modify metrics service endpoint (#3443)
parent
685d8980
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
0 deletions
+2
-0
python/sglang/srt/utils.py
python/sglang/srt/utils.py
+2
-0
No files found.
python/sglang/srt/utils.py
View file @
c44f2869
...
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment