Skip to content

fix(outbound-http): ensure tracing span records land on send_request span for P3#3496

Merged
itowlson merged 2 commits intospinframework:mainfrom
ChihweiLHBird:zhiwei/fix-p3-tracing-span
May 6, 2026
Merged

fix(outbound-http): ensure tracing span records land on send_request span for P3#3496
itowlson merged 2 commits intospinframework:mainfrom
ChihweiLHBird:zhiwei/fix-p3-tracing-span

Conversation

@ChihweiLHBird
Copy link
Copy Markdown
Contributor

@ChihweiLHBird ChihweiLHBird commented May 6, 2026

Summary

Fix a tracing span propagation bug in the WASI Preview 3 outbound HTTP path.

p3::WasiHttpHooks::send_request returns a boxed future. The #[instrument(name = "spin_outbound_http.send_request")] span exits immediately, so later Span::record(...) calls (e.g. url.full, server.address) inside the async work were lost.

Wrap the async block with .in_current_span() so the instrumented span remains current when the future is polled. This matches the P2 implementation.

cargo test -p spin-factor-outbound-http p3_send_request_propagates_span_to_async_work

…span for P3

Signed-off-by: Zhiwei Liang <zhiwei.liang@zliang.me>
@ChihweiLHBird ChihweiLHBird force-pushed the zhiwei/fix-p3-tracing-span branch from f2debab to d8ecc47 Compare May 6, 2026 07:06
@fibonacci1729 fibonacci1729 requested a review from calebschoepp May 6, 2026 16:19
Signed-off-by: Zhiwei Liang <zhiwei.liang@zliang.me>
@ChihweiLHBird ChihweiLHBird force-pushed the zhiwei/fix-p3-tracing-span branch from 2ba7e1a to d70673a Compare May 6, 2026 17:27
Copy link
Copy Markdown
Collaborator

@calebschoepp calebschoepp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@itowlson itowlson merged commit 1aebeda into spinframework:main May 6, 2026
32 of 33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants