Skip to content

refactor: remove unused request IDs and streamline request handling#133

Merged
ruslanti merged 2 commits into
mainfrom
fix/hostname-resolution
May 11, 2026
Merged

refactor: remove unused request IDs and streamline request handling#133
ruslanti merged 2 commits into
mainfrom
fix/hostname-resolution

Conversation

@ruslanti
Copy link
Copy Markdown
Collaborator

  • Eliminated request_id parameter from handle_request method to simplify the interface.
  • Replaced request_id usage with traceparent for consistent tracing.
  • Improved hostname resolution logic for backend, prioritizing server_name header.
  • Enhanced tracing with in_current_span for better debugging context.
  • Updated test cases to align with the new method signature.

- Eliminated `request_id` parameter from `handle_request` method to simplify the interface.
- Replaced `request_id` usage with `traceparent` for consistent tracing.
- Improved hostname resolution logic for backend, prioritizing `server_name` header.
- Enhanced tracing with `in_current_span` for better debugging context.
- Updated test cases to align with the new method signature.
Copilot AI review requested due to automatic review settings May 11, 2026 10:22
@ruslanti ruslanti self-assigned this May 11, 2026
@ruslanti ruslanti added the bug Something isn't working label May 11, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors HttpService request handling by removing the explicit request_id parameter and shifting request correlation to traceparent, while also improving tracing propagation and backend hostname resolution behavior.

Changes:

  • Removed the request_id argument from HttpService::handle_request and updated call sites/tests accordingly.
  • Switched request correlation to traceparent and attached it to the per-request tracing span.
  • Updated the WASI HTTP executor to resolve backend hostname with a server_name header override and to propagate tracing context into spawned tasks.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
crates/http-service/src/lib.rs Removes request_id from handle_request, derives traceparent from headers, and updates tracing/stats correlation accordingly.
crates/http-service/src/executor/wasi_http.rs Adds server_name-first hostname resolution and wraps spawned handler execution with in_current_span() for trace continuity.
crates/http-service/src/executor/http.rs Updates unit tests to call the new handle_request(req) signature.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread crates/http-service/src/lib.rs Outdated
Comment thread crates/http-service/src/lib.rs
Comment thread crates/http-service/src/lib.rs Outdated
Comment thread crates/http-service/src/executor/wasi_http.rs
- Reordered and cleaned up imports across modules for readability.
- Added `traceparent` to tracing logs for enhanced observability.
- Adjusted `handle_request` tracing span to use `http` for clarity.
- Fixed formatting issues in `handle_request`.
- Replaced `SERVER_NAME` with `SERVER_NAME_HEADER` for hostname resolution consistency.
- Streamlined `remote_traceparent` method signature.
- Updated tests to reflect changes in import order.
@ruslanti ruslanti requested review from godronus and qrdl May 11, 2026 10:43
@ruslanti ruslanti merged commit ec4b2a8 into main May 11, 2026
4 of 6 checks passed
@ruslanti ruslanti deleted the fix/hostname-resolution branch May 11, 2026 10:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants