Skip to content

Commit

Permalink
[BUG]: fix tracing for IO tasks (#2652)
Browse files Browse the repository at this point in the history
  • Loading branch information
codetheweb authored Aug 9, 2024
1 parent 03fb773 commit 76ba51a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions rust/worker/src/execution/dispatcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use async_trait::async_trait;
use chroma_config::Configurable;
use chroma_error::ChromaError;
use std::fmt::Debug;
use tracing::Span;
use tracing::{trace_span, Instrument, Span};

/// The dispatcher is responsible for distributing tasks to worker threads.
/// It is a component that receives tasks and distributes them to worker threads.
Expand Down Expand Up @@ -96,8 +96,9 @@ impl Dispatcher {
async fn enqueue_task(&mut self, task: TaskMessage) {
match task.get_type() {
OperatorType::IO => {
let child_span = trace_span!(parent: Span::current(), "IO task execution", name = task.get_name());
tokio::spawn(async move {
task.run().await;
task.run().instrument(child_span).await;
});
}
OperatorType::Other => {
Expand Down

0 comments on commit 76ba51a

Please sign in to comment.