refactor: remove unused request IDs and streamline request handling#133
Merged
Conversation
- 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.
qrdl
approved these changes
May 11, 2026
Contributor
There was a problem hiding this comment.
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_idargument fromHttpService::handle_requestand updated call sites/tests accordingly. - Switched request correlation to
traceparentand attached it to the per-request tracing span. - Updated the WASI HTTP executor to resolve backend hostname with a
server_nameheader 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.
- 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.
qrdl
approved these changes
May 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
request_idparameter fromhandle_requestmethod to simplify the interface.request_idusage withtraceparentfor consistent tracing.server_nameheader.in_current_spanfor better debugging context.