Skip to content

Conversation

@davidB
Copy link
Contributor

@davidB davidB commented Nov 3, 2025

Allow to propage the tracing'span between axum middleware and

  • Do you want me to include the sample project used in the issue (the test pass with the fix)?
  • TBH I don't fully understand why a new rt is spawned,...
❯ mise run //server:test
[//server:test] $ mkdir -p target/debug/deps/public
[//server:test] $ cargo nextest run --all-features --workspace
   Compiling dioxus-server v0.7.0 (/mnt/nvme0n1p1/david/src/github.com/davidB/dioxus/packages/fullstack-server)
   Compiling dioxus v0.7.0 (/mnt/nvme0n1p1/david/src/github.com/davidB/dioxus/packages/dioxus)
   Compiling cdviz-saas v0.2.1 (/mnt/nvme0n1p1/david/src/github.com/cdviz-dev/cdviz-saas/server)
    Finished `test` profile [unoptimized + debuginfo] target(s) in 5.32s
────────────
 Nextest run ID f183a468-dec9-46ae-ae05-c3db963c849b with nextest profile: default
    Starting 2 tests across 1 binary
        PASS [   0.061s] cdviz-saas::bin/cdviz-saas main_server::tests::test_header_tracing::case_2
        PASS [   0.063s] cdviz-saas::bin/cdviz-saas main_server::tests::test_header_tracing::case_1
────────────
     Summary [   0.065s] 2 tests run: 2 passed, 0 skipped

cdviz-saas on  gitbutler/workspace [!] took 6s


❯ curl -i http://127.0.0.1:8080/api/200
HTTP/1.1 200 OK
content-type: application/json
traceparent: 00-34a16530379a4748739288c39280efc6-044c9ee7a10cda02-01
tracestate:
content-length: 34
date: Mon, 03 Nov 2025 17:17:28 GMT
vary: origin, access-control-request-method, access-control-request-headers
access-control-allow-origin: *

"34a16530379a4748739288c39280efc6"

FIX #4896

@davidB davidB requested a review from a team as a code owner November 3, 2025 17:22
@jkelleyrtp
Copy link
Member

don't fully understand why a new rt is spawned,.

We create a localset so spawn_local works - and we also progress requests on local runtime you can use !Send types in your server functions.

Thanks for the PR!

@jkelleyrtp jkelleyrtp merged commit 6f0c647 into DioxusLabs:main Nov 5, 2025
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants