Skip to content

Commit 8cb82e9

Browse files
committed
fix: Replace long running span with short lived spans
1 parent 049be36 commit 8cb82e9

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/main.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,7 @@ fn main() {
4343
.init()
4444
.unwrap();
4545

46-
// Wrap *all* output in a span, to separate it from main app output.
47-
let _span = tracing::error_span!("containerdebug").entered();
46+
let init_span = tracing::error_span!("containerdebug init").entered();
4847

4948
stackable_operator::utils::print_startup_string(
5049
crate_description!(),
@@ -58,7 +57,12 @@ fn main() {
5857
let mut collect_ctx = SystemInformation::init();
5958

6059
let mut next_run = Instant::now();
60+
61+
drop(init_span);
6162
loop {
63+
// Wrap *all* output in a span, to separate it from main app output.
64+
let _span = tracing::error_span!("containerdebug run").entered();
65+
6266
let next_run_sleep = next_run.saturating_duration_since(Instant::now());
6367
if !next_run_sleep.is_zero() {
6468
tracing::info!(?next_run, "scheduling next run...");

0 commit comments

Comments
 (0)