feat(leptos-axum): propagate trace context to server functions (#2340)

This commit is contained in:
Janu (Janeshwar) Cambrelen 2024-02-21 20:21:00 -07:00 committed by GitHub
parent 747aba0d7f
commit 0a73487152
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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);