Support HTTP response status code prometheus metrics (#14710)
This commit is contained in:
@@ -122,6 +122,7 @@ from sglang.srt.server_args import PortArgs, ServerArgs
|
||||
from sglang.srt.utils import (
|
||||
add_api_key_middleware,
|
||||
add_prometheus_middleware,
|
||||
add_prometheus_track_response_middleware,
|
||||
delete_directory,
|
||||
get_bool_env_var,
|
||||
kill_process_tree,
|
||||
@@ -1397,6 +1398,9 @@ def launch_server(
|
||||
)
|
||||
)
|
||||
|
||||
if server_args.enable_metrics:
|
||||
add_prometheus_track_response_middleware(app)
|
||||
|
||||
# Pass additional arguments to the lifespan function.
|
||||
# They will be used for additional initialization setups.
|
||||
if server_args.tokenizer_worker_num == 1:
|
||||
|
||||
Reference in New Issue
Block a user