Skip to content

Commit

Permalink
fix: client_request span triggers
Browse files Browse the repository at this point in the history
  • Loading branch information
Theodus committed Dec 4, 2024
1 parent 740dc22 commit dac6129
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/middleware/request_tracing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,11 @@ where
}

fn call(&mut self, req: Request<ReqBody>) -> Self::Future {
// Create a tracing span for the client request and enter it. This way events created by the different layers
// in the middleware stack are associated with it.
let client_request_span = tracing::info_span!(
"client_request", // name
self.inner.call(req).instrument(tracing::info_span!(
"client_request",
request_id = field::Empty,
selector = field::Empty,
)
.entered();

self.inner.call(req).instrument(client_request_span.clone())
))
}
}

Expand Down

0 comments on commit dac6129

Please sign in to comment.