Set auction_id
as request_id
in autopilot
#3243
Merged
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.
Description
We have some machinery in place to trace logs of different pods that relate to the same request by generating request_ids and forwarding them using HTTP headers to the next pod. The next pod will then read this header and attach the id to all its logs.
If an incoming request does not have an id the pod will generate a new id based on a counter and use that for the request.
The component that generates request ids for incoming user requests actually lives outside the services pod. That means for incoming user requests we never have to worry about generating these ids ourselves. But the autopilot does respond to external requests so it only relies on its internal counter to generate these ids.
This is not great since these autogenerated ids don't relate to any auction id in the autopilot.
Changes
To make tracing of requests that originated from the autopilot easier we now use the current auction's id as the request id. This should hopefully allow us to identify the auction a requests we sent to the mevblocker proxy was associated with.
Also we now for the first time even set the necessary
X-REQUEST-ID
header in the autopilot -> driver requests.I also changed the code to not use the underlying
REQUEST_ID
anymore since we have helper functions that are supposed to be used for that.How to test
added a unit test to demonstrate the behavior of the helper functions
Since the CI only prints logs on failures I copied a log from a local run showing that the request_id is the same as the auction_id: