@@ -11,7 +11,7 @@ use eyre::Result;
1111use prometheus:: core:: { AtomicI64 , AtomicU64 , GenericCounter , GenericGauge } ;
1212use tokio:: sync:: { mpsc:: Receiver as MpscReceiver , Mutex } ;
1313use tokio:: time:: sleep;
14- use tracing:: { debug, info, instrument, trace, warn} ;
14+ use tracing:: { debug, info, instrument, trace, warn, Instrument } ;
1515
1616use hyperlane_core:: {
1717 utils:: fmt_sync_time, ContractSyncCursor , CursorAction , HyperlaneDomain , HyperlaneLogStore ,
9797 }
9898
9999 /// Sync logs and write them to the LogStore
100- #[ instrument( name = "ContractSync" , fields( domain=self . domain( ) . name( ) ) , skip( self , opts) ) ]
100+ #[ instrument( name = "ContractSync" , fields( domain=self . domain( ) . name( ) , label ) , skip( self , opts) ) ]
101101 pub async fn sync ( & self , label : & ' static str , opts : SyncOptions < T > ) {
102102 let chain_name = self . domain . as_ref ( ) ;
103103 let indexed_height_metric = self
@@ -155,19 +155,26 @@ where
155155
156156 let stored_logs_metric = stored_logs_metric. clone ( ) ;
157157
158- tokio:: task:: spawn ( async {
159- Self :: cursor_indexer_task (
160- domain_clone,
161- indexer_clone,
162- store_clone,
163- cursor,
164- broadcast_sender,
165- stored_logs_metric,
166- indexed_height_metric,
167- liveness_metric,
168- )
169- . await ;
170- } )
158+ tokio:: task:: spawn (
159+ async {
160+ Self :: cursor_indexer_task (
161+ domain_clone,
162+ indexer_clone,
163+ store_clone,
164+ cursor,
165+ broadcast_sender,
166+ stored_logs_metric,
167+ indexed_height_metric,
168+ liveness_metric,
169+ )
170+ . await
171+ }
172+ . instrument ( tracing:: info_span!(
173+ "spawn_cursor_indexer_task" ,
174+ domain = self . domain( ) . name( ) ,
175+ label
176+ ) ) ,
177+ )
171178 }
172179 None => tokio:: task:: spawn ( async { } ) ,
173180 } ;
0 commit comments