diff --git a/src/bootstrap/src/utils/exec.rs b/src/bootstrap/src/utils/exec.rs index 453a4b056b20..1568c6f15243 100644 --- a/src/bootstrap/src/utils/exec.rs +++ b/src/bootstrap/src/utils/exec.rs @@ -604,6 +604,8 @@ pub struct StreamingCommand { pub stderr: Option, fingerprint: CommandFingerprint, start_time: Instant, + #[cfg(feature = "tracing")] + _span_guard: tracing::span::EnteredSpan, } #[must_use] @@ -800,6 +802,10 @@ impl ExecutionContext { if !command.run_in_dry_run && self.dry_run() { return None; } + + #[cfg(feature = "tracing")] + let span_guard = trace_cmd!(command); + let start_time = Instant::now(); let fingerprint = command.fingerprint(); let cmd = &mut command.command; @@ -813,7 +819,15 @@ impl ExecutionContext { let stdout = child.stdout.take(); let stderr = child.stderr.take(); - Some(StreamingCommand { child, stdout, stderr, fingerprint, start_time }) + Some(StreamingCommand { + child, + stdout, + stderr, + fingerprint, + start_time, + #[cfg(feature = "tracing")] + _span_guard: span_guard, + }) } }