Skip to content

Commit 57ee3f2

Browse files
committed
add span to streaming command execution flow
1 parent acbbc18 commit 57ee3f2

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

src/bootstrap/src/utils/exec.rs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -604,6 +604,8 @@ pub struct StreamingCommand {
604604
pub stderr: Option<ChildStderr>,
605605
fingerprint: CommandFingerprint,
606606
start_time: Instant,
607+
#[cfg(feature = "tracing")]
608+
_span_guard: tracing::span::EnteredSpan,
607609
}
608610

609611
#[must_use]
@@ -800,6 +802,10 @@ impl ExecutionContext {
800802
if !command.run_in_dry_run && self.dry_run() {
801803
return None;
802804
}
805+
806+
#[cfg(feature = "tracing")]
807+
let span_guard = trace_cmd!(command);
808+
803809
let start_time = Instant::now();
804810
let fingerprint = command.fingerprint();
805811
let cmd = &mut command.command;
@@ -813,7 +819,15 @@ impl ExecutionContext {
813819

814820
let stdout = child.stdout.take();
815821
let stderr = child.stderr.take();
816-
Some(StreamingCommand { child, stdout, stderr, fingerprint, start_time })
822+
Some(StreamingCommand {
823+
child,
824+
stdout,
825+
stderr,
826+
fingerprint,
827+
start_time,
828+
#[cfg(feature = "tracing")]
829+
_span_guard: span_guard,
830+
})
817831
}
818832
}
819833

0 commit comments

Comments
 (0)