diff --git a/aquamarine/src/actor.rs b/aquamarine/src/actor.rs index aade4b53d9..1918c41b3a 100644 --- a/aquamarine/src/actor.rs +++ b/aquamarine/src/actor.rs @@ -160,7 +160,7 @@ where if let Some(Ready((reusables, effects, stats, span))) = self.future.as_mut().map(|f| f.poll_unpin(cx)) { - let local_span = tracing::info_span!(parent: span.as_ref(), "Poll AVM future"); + let local_span = tracing::info_span!(parent: span.as_ref(), "Poll AVM future", particle_id= self.particle.id, deal_id = self.deal_id); let _span_guard = local_span.enter(); self.future.take(); @@ -235,11 +235,15 @@ where let key_pair = self.key_pair.clone(); let async_span = if let Some(ext_particle) = ext_particle.as_ref() { - tracing::info_span!(parent: ext_particle.span.as_ref(),"Actor: async AVM process particle & call results",particle_id = particle.id) + tracing::info_span!(parent: ext_particle.span.as_ref(), + "Actor: async AVM process particle & call results", + particle_id = particle.id, + deal_id = self.deal_id) } else { tracing::info_span!( "Actor: async AVM process call results", - particle_id = particle.id + particle_id = particle.id, + deal_id = self.deal_id ) }; for span in spans { diff --git a/sorcerer/src/script_executor.rs b/sorcerer/src/script_executor.rs index 214e8c2417..0305c4f347 100644 --- a/sorcerer/src/script_executor.rs +++ b/sorcerer/src/script_executor.rs @@ -54,6 +54,7 @@ impl Sorcerer { .map_err(|e| JError::new(e.to_string())) } + #[instrument(level = tracing::Level::INFO, skip_all)] pub(crate) fn make_spell_particle( &self, spell_id: String, @@ -114,7 +115,7 @@ impl Sorcerer { m.observe_spell_cast(); } - let async_span = tracing::info_span!(parent: span.as_ref(), "Script executor: aquamarine async execute"); + let async_span = tracing::info_span!(parent: span.as_ref(), "Script executor: aquamarine async execute", spell_id = event.spell_id.to_string()); self.aquamarine .clone() @@ -125,10 +126,10 @@ impl Sorcerer { if let Err(err) = error { log::warn!( - "Failed to execute spell script id: {}, event: {:?}, error: {:?}", - event.spell_id, + "Failed to execute spell script id: {spell_id}, event: {:?}, error: {:?}", event.info, - err + err, + spell_id = event.spell_id.to_string(), ); } } diff --git a/sorcerer/src/sorcerer.rs b/sorcerer/src/sorcerer.rs index a995f31b85..c9ead11470 100644 --- a/sorcerer/src/sorcerer.rs +++ b/sorcerer/src/sorcerer.rs @@ -149,12 +149,17 @@ impl Sorcerer { spell_id = spell_event.spell_id.to_string() ); let root_span = Arc::new(root_span); - let async_span = tracing::info_span!(parent: root_span.as_ref(), "Sorcerer: async execute script"); + let async_span = tracing::info_span!(parent: root_span.as_ref(), + "Sorcerer: async execute script", + spell_id = spell_event.spell_id.to_string()); let sorcerer = self.clone(); // Note that the event that triggered the spell is in `spell_event.event` async move { - sorcerer.execute_script(spell_event,root_span).await; + sorcerer + .execute_script(spell_event, root_span) + .in_current_span() + .await; } .instrument(async_span) })