[Observability] Add Prometheus metrics endpoint for gRPC mode (#20801)

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Kangyan-Zhou
2026-04-09 20:04:54 -07:00
committed by GitHub
co-authored by Claude Opus 4.6
parent 42ffb168b3
commit 89553ff82b
2 changed files with 113 additions and 1 deletions
+9
View File
@@ -405,6 +405,7 @@ class ServerArgs:
crash_dump_folder: Optional[str] = None
show_time_cost: bool = False
enable_metrics: bool = False
metrics_http_port: Optional[int] = None
enable_mfu_metrics: bool = False
enable_metrics_for_all_schedulers: bool = False
tokenizer_metrics_custom_labels_header: str = "x-custom-labels"
@@ -4515,6 +4516,14 @@ class ServerArgs:
action="store_true",
help="Enable log prometheus metrics.",
)
parser.add_argument(
"--metrics-http-port",
type=int,
default=ServerArgs.metrics_http_port,
help="Port for the Prometheus metrics HTTP server. "
"Only used in gRPC mode (--grpc-mode); in HTTP mode, metrics are served on the main --port. "
"Defaults to --port + 1 when --enable-metrics is set.",
)
parser.add_argument(
"--enable-mfu-metrics",
action="store_true",