File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
src/dstack/_internal/proxy/gateway/model_routers Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,10 @@ def start(self) -> None:
4848 # Use Python from the active venv
4949 venv_python = DSTACK_DIR_ON_GATEWAY / version / "bin" / "python3"
5050
51+ # Calculate prometheus port: router_port + 10000
52+ # Router ports: 20000-24999, Prometheus ports: 30000-34999
53+ prometheus_port = self .context .port + 10000
54+
5155 cmd = [
5256 str (venv_python ),
5357 "-m" ,
@@ -56,6 +60,8 @@ def start(self) -> None:
5660 "0.0.0.0" , # Bind to all interfaces (nginx connects via 127.0.0.1)
5761 "--port" ,
5862 str (self .context .port ),
63+ "--prometheus-port" ,
64+ str (prometheus_port ),
5965 # Note: No --enable-igw flag for this router type
6066 "--log-level" ,
6167 self .context .log_level ,
@@ -75,7 +81,11 @@ def start(self) -> None:
7581 if not self .is_running ():
7682 raise Exception (f"Failed to start sglang router on port { self .context .port } " )
7783
78- logger .info ("Sglang router started successfully on port %s" , self .context .port )
84+ logger .info (
85+ "Sglang router started successfully on port %s (prometheus on %s)" ,
86+ self .context .port ,
87+ prometheus_port ,
88+ )
7989
8090 except Exception as e :
8191 logger .error (f"Failed to start sglang-router-new: { e } " )
You can’t perform that action at this time.
0 commit comments