Add X-Request-ID header to requests and logs - #148
Merged
Merged
Conversation
kevinmcconnell
force-pushed
the
request-id
branch
6 times, most recently
from
August 24, 2026 15:56
130dd12 to
b116e89
Compare
Tag each request with an X-Request-ID header, so that the ID is available to the upstream server and recorded in our request logs as request_id. When FORWARD_HEADERS is enabled, an ID supplied by a downstream proxy is kept, matching how we treat X-Forwarded-*. Thruster owns the response header: the middleware sets it on every response, and the proxy drops the upstream's echoed copy. This keeps the ID out of the response cache, so cache hits carry the ID of their own request rather than a replayed one.
ReverseProxy strips any header the client names in its Connection header. That's correct hop-by-hop behavior for the client's own headers, but X-Request-ID and X-Request-Start are ours: we add them for the app, and the client shouldn't be able to suppress them. Restore them in Rewrite, the same way the stdlib handles X-Forwarded-*.
kevinmcconnell
force-pushed
the
request-id
branch
from
August 24, 2026 16:05
b116e89 to
f25e0fb
Compare
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.
Tag each request with an X-Request-ID header, so that the ID is available to the upstream server and recorded in our request logs as request_id.
When FORWARD_HEADERS is enabled, an ID supplied by a downstream proxy is kept, matching how we treat X-Forwarded-*.
Closes #139