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
36d6f0ba
Unverified
Commit
36d6f0ba
authored
Jul 27, 2025
by
Yingchun Lai
Committed by
GitHub
Jul 27, 2025
Browse files
fix: fix the missing metrics on non-rank0 nodes (#7720)
parent
2a1936de
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
2 deletions
+11
-2
python/sglang/srt/entrypoints/engine.py
python/sglang/srt/entrypoints/engine.py
+3
-1
python/sglang/srt/utils.py
python/sglang/srt/utils.py
+8
-1
No files found.
python/sglang/srt/entrypoints/engine.py
View file @
36d6f0ba
...
...
@@ -765,7 +765,9 @@ def _launch_subprocesses(
# When using `Engine` as a Python API, we don't want to block here.
return
None
,
None
,
None
launch_dummy_health_check_server
(
server_args
.
host
,
server_args
.
port
)
launch_dummy_health_check_server
(
server_args
.
host
,
server_args
.
port
,
server_args
.
enable_metrics
)
for
proc
in
scheduler_procs
:
proc
.
join
()
...
...
python/sglang/srt/utils.py
View file @
36d6f0ba
...
...
@@ -85,6 +85,8 @@ from torch.profiler import ProfilerActivity, profile, record_function
from
torch.utils._contextlib
import
_DecoratorContextManager
from
triton.runtime.cache
import
FileCacheManager
from
sglang.srt.metrics.func_timer
import
enable_func_timer
logger
=
logging
.
getLogger
(
__name__
)
show_time_cost
=
False
...
...
@@ -2049,7 +2051,7 @@ def rank0_log(msg: str):
logger
.
info
(
msg
)
def
launch_dummy_health_check_server
(
host
,
port
):
def
launch_dummy_health_check_server
(
host
,
port
,
enable_metrics
):
import
asyncio
import
uvicorn
...
...
@@ -2067,6 +2069,11 @@ def launch_dummy_health_check_server(host, port):
"""Check the health of the http server."""
return
Response
(
status_code
=
200
)
# Add prometheus middleware
if
enable_metrics
:
add_prometheus_middleware
(
app
)
enable_func_timer
()
config
=
uvicorn
.
Config
(
app
,
host
=
host
,
...
...
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