-
Notifications
You must be signed in to change notification settings - Fork 632
feat: Add PoC of sglang metrics server (default port 30000) #3407
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,9 +6,10 @@ | |
import signal | ||
import sys | ||
|
||
import sglang as sgl | ||
import uvloop | ||
from sglang.srt.utils import launch_dummy_health_check_server | ||
|
||
import sglang as sgl | ||
from dynamo.llm import ModelInput, ModelType | ||
from dynamo.runtime import DistributedRuntime, dynamo_worker | ||
from dynamo.runtime.logging import configure_dynamo_logging | ||
|
@@ -66,6 +67,10 @@ async def init(runtime: DistributedRuntime, config: Config): | |
server_args, dynamo_args = config.server_args, config.dynamo_args | ||
|
||
engine = sgl.Engine(server_args=server_args) | ||
if server_args.enable_metrics: | ||
launch_dummy_health_check_server( | ||
server_args.host, server_args.port, server_args.enable_metrics | ||
) | ||
Comment on lines
+70
to
+73
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion | 🟠 Major 🧩 Analysis chainVerify the port parameter matches the intended metrics port. According to the PR description, the metrics server should run on port 30000 by default. However, this code passes Please confirm whether:
Run the following script to check how 🏁 Script executed: #!/bin/bash
# Description: Check server_args configuration and port usage
# Find where server_args is defined and what ports are available
ast-grep --pattern 'class $_ {
$$$
port = $$$
$$$
}'
# Search for metrics_port or similar configuration
rg -nP '(metrics_port|port.*30000|30000)' --type=py -C3
# Check the args parsing to see available port configurations
rg -nP 'def\s+parse_args' --type=py -A 50 Length of output: 47344 Introduce a dedicated The metrics server currently binds to 🤖 Prompt for AI Agents
|
||
|
||
component = runtime.namespace(dynamo_args.namespace).component( | ||
dynamo_args.component | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some things to consider either now or later:
if server_args.enable_metrics:
server_args.enable_metrics = True
in our worker codeThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in the future when we expose metrics via rust endpoint - do we need the dummy health check any more?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would use the same flag as sglang - but ideally it would be surfaced via our endpoint and not need a seperate server - but that is dependent on wait we find from @keivenchang 's work