File tree Expand file tree Collapse file tree 3 files changed +36
-0
lines changed
Expand file tree Collapse file tree 3 files changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -87,6 +87,14 @@ async fn main() -> Result<()> {
8787 "Starting audit archiver"
8888 ) ;
8989
90+ if args. tracing_enabled {
91+ init_tracing (
92+ env ! ( "CARGO_PKG_NAME" ) . to_string ( ) ,
93+ env ! ( "CARGO_PKG_VERSION" ) . to_string ( ) ,
94+ args. tracing_otlp_endpoint ,
95+ ) ?;
96+ }
97+
9098 let consumer = create_kafka_consumer ( & args. kafka_brokers , & args. kafka_group_id ) ?;
9199 consumer. subscribe ( & [ & args. kafka_topic ] ) ?;
92100
Original file line number Diff line number Diff line change @@ -35,6 +35,12 @@ struct Args {
3535
3636 #[ arg( long, env = "TIPS_INGRESS_WRITER_LOG_LEVEL" , default_value = "info" ) ]
3737 log_level : String ,
38+
39+ #[ arg( long, env = "TIPS_INGRESS_WRITER_TRACING_ENABLED" , default_value = "false" ) ]
40+ tracing_enabled : bool ,
41+
42+ #[ arg( long, env = "TIPS_INGRESS_WRITER_TRACING_OTLP_ENDPOINT" , default_value = "http://localhost:4317" ) ]
43+ tracing_otlp_endpoint : String ,
3844}
3945
4046/// IngressWriter consumes bundles sent from the Ingress service and writes them to the datastore
@@ -129,6 +135,14 @@ async fn main() -> Result<()> {
129135 . with_env_filter ( & args. log_level )
130136 . init ( ) ;
131137
138+ if args. tracing_enabled {
139+ init_tracing (
140+ env ! ( "CARGO_PKG_NAME" ) . to_string ( ) ,
141+ env ! ( "CARGO_PKG_VERSION" ) . to_string ( ) ,
142+ args. tracing_otlp_endpoint ,
143+ ) ?;
144+ }
145+
132146 let mut config = ClientConfig :: new ( ) ;
133147 config
134148 . set ( "group.id" , & args. kafka_group_id )
Original file line number Diff line number Diff line change @@ -38,6 +38,12 @@ struct Args {
3838
3939 #[ arg( long, env = "TIPS_MAINTENANCE_LOG_LEVEL" , default_value = "info" ) ]
4040 log_level : String ,
41+
42+ #[ arg( long, env = "TIPS_MAINTENANCE_TRACING_ENABLED" , default_value = "false" ) ]
43+ tracing_enabled : bool ,
44+
45+ #[ arg( long, env = "TIPS_MAINTENANCE_TRACING_OTLP_ENDPOINT" , default_value = "http://localhost:4317" ) ]
46+ tracing_otlp_endpoint : String ,
4147}
4248
4349#[ tokio:: main]
@@ -71,6 +77,14 @@ async fn main() -> Result<()> {
7177
7278 info ! ( "Starting maintenance service" ) ;
7379
80+ if args. tracing_enabled {
81+ init_tracing (
82+ env ! ( "CARGO_PKG_NAME" ) . to_string ( ) ,
83+ env ! ( "CARGO_PKG_VERSION" ) . to_string ( ) ,
84+ args. tracing_otlp_endpoint ,
85+ ) ?;
86+ }
87+
7488 let provider: RootProvider < Optimism > = ProviderBuilder :: new ( )
7589 . disable_recommended_fillers ( )
7690 . network :: < Optimism > ( )
You can’t perform that action at this time.
0 commit comments