Skip to content

Commit

Permalink
feat(leptos-axum): propagate trace context to server functions (#2340)
Browse files Browse the repository at this point in the history
  • Loading branch information
janu-cambrelen authored Feb 22, 2024
1 parent 747aba0 commit 0a73487
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions integrations/axum/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,13 @@ async fn handle_server_fns_inner(

let (tx, rx) = futures::channel::oneshot::channel();

// capture current span to enable trace context propagation
let current_span = tracing::Span::current();

spawn_task!(async move {
// enter captured span for trace context propagation in spawned task
let _guard = current_span.enter();

let path = req.uri().path().to_string();
let (req, parts) = generate_request_and_parts(req);

Expand Down

0 comments on commit 0a73487

Please sign in to comment.