File tree 3 files changed +20
-11
lines changed
3 files changed +20
-11
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ humantime-serde = "1.1"
18
18
hyper = { version = " 1.2.0" , features = [" full" ] }
19
19
hyper-util = { version = " 0.1.3" , features = [" full" ] }
20
20
http-body-util = " 0.1.0"
21
- jemallocator = " 0.5.4"
21
+ jemallocator = { version = " 0.5.4" }
22
22
once_cell = " 1.17.1"
23
23
ott-common = { path = " crates/ott-common" }
24
24
ott-balancer = { path = " crates/ott-balancer" }
Original file line number Diff line number Diff line change @@ -79,10 +79,14 @@ pub struct Cli {
79
79
#[ clap( short, long, default_value_t = LogLevel :: Info , value_enum) ]
80
80
pub log_level : LogLevel ,
81
81
82
+ /// Enable the console-subscriber for debugging via tokio-console.
83
+ #[ clap( long) ]
84
+ pub console : bool ,
85
+
82
86
/// Allow remote connections via tokio-console for debugging. By default, only local connections are allowed.
83
87
///
84
88
/// The default port for tokio-console is 6669.
85
- #[ clap( long) ]
89
+ #[ clap( long, requires ( "console" ) ) ]
86
90
pub remote_console : bool ,
87
91
88
92
/// Validate the configuration file.
Original file line number Diff line number Diff line change @@ -56,17 +56,22 @@ pub async fn run() -> anyhow::Result<()> {
56
56
57
57
let config = BalancerConfig :: get ( ) ;
58
58
59
- let console_layer = if args. remote_console {
60
- console_subscriber:: ConsoleLayer :: builder ( )
61
- . server_addr ( (
62
- Ipv6Addr :: UNSPECIFIED ,
63
- console_subscriber:: Server :: DEFAULT_PORT ,
64
- ) )
65
- . spawn ( )
59
+ let console_layer = if args. console {
60
+ let console_layer = if args. remote_console {
61
+ console_subscriber:: ConsoleLayer :: builder ( )
62
+ . server_addr ( (
63
+ Ipv6Addr :: UNSPECIFIED ,
64
+ console_subscriber:: Server :: DEFAULT_PORT ,
65
+ ) )
66
+ . spawn ( )
67
+ } else {
68
+ console_subscriber:: ConsoleLayer :: builder ( ) . spawn ( )
69
+ }
70
+ . with_filter ( EnvFilter :: try_new ( "tokio=trace,runtime=trace" ) ?) ;
71
+ Some ( console_layer)
66
72
} else {
67
- console_subscriber :: ConsoleLayer :: builder ( ) . spawn ( )
73
+ None
68
74
} ;
69
- let console_layer = console_layer. with_filter ( EnvFilter :: try_new ( "tokio=trace,runtime=trace" ) ?) ;
70
75
let filter = args. build_tracing_filter ( ) ;
71
76
let filter_layer = EnvFilter :: try_from_default_env ( ) . or_else ( |_| EnvFilter :: try_new ( filter) ) ?;
72
77
let fmt_layer = tracing_subscriber:: fmt:: layer ( ) . with_filter ( filter_layer) ;
You can’t perform that action at this time.
0 commit comments