Closed chenyukang closed 2 months ago
There are two drawbacks for https://github.com/nervosnetwork/cfn-node/pull/120
There are several methods to propagate the span to spawned tasks:
instrument when using tokio spawn or actor span:
instrument
Actor::spawn_linked(...).instrument(span).await;
instrument with macors for a function
#[tracing::instrument(name = "Actor", skip(self, myself, args), fields(id = crate::get_node_prefix()))] async fn pre_start( &self, myself: ActorRef<Self::Msg>, args: Self::Arguments, ) -> Result<Self::State, ActorProcessingErr> { ... }
This PR use a trivial hack to achieve it, I think it's more general since developers may forget to set instrument for actors.
There are two drawbacks for https://github.com/nervosnetwork/cfn-node/pull/120
There are several methods to propagate the span to spawned tasks:
instrument
when using tokio spawn or actor span:instrument
with macors for a functionThis PR use a trivial hack to achieve it, I think it's more general since developers may forget to set
instrument
for actors.