Skip to content

Commit

Permalink
move span status inside thread (#139)
Browse files Browse the repository at this point in the history
  • Loading branch information
ermalkaleci authored Nov 21, 2023
1 parent 7523b16 commit b732b66
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/middlewares/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,10 @@ impl<Request: Debug + Send + 'static, Result: Send + 'static> Middlewares<Reques
async move {
let result = next(request, TypeRegistry::new()).await;
_ = result_tx.send(result);

opentelemetry::trace::get_active_span(|span| {
span.set_status(opentelemetry::trace::Status::Ok);
});
}
.with_context(TRACER.context("middlewares")),
);
Expand All @@ -157,9 +161,6 @@ impl<Request: Debug + Send + 'static, Result: Send + 'static> Middlewares<Reques
}
_ = &mut task_handle => {
tracing::trace!("middlewares finished: {req}");
opentelemetry::trace::get_active_span(|span| {
span.set_status(opentelemetry::trace::Status::Ok);
});
}
}
}
Expand Down

0 comments on commit b732b66

Please sign in to comment.