proposal: net/http: Transport tracing hooks #56241
The current HTTP client instrumentation library httptrace tracks the life cycle of a single request with hooks present at different stages in the outgoing HTTP Request's journey. This limits the use of
Here is a basic example of the proposed change. Let’s take the example of the
We propose restructuring
And one would make a request in the following way:-
The above basic proposal can be extended to all the hooks already present in
These hooks could take as parameters
Note: I have already implemented this during an internship.
The text was updated successfully, but these errors were encountered:
This proposal is for two unrelated things: A way to run per-request trace hooks for every request on an
You need to separate these parts. Do you want to propose a way to run
We don't want to have two entirely different per-request tracing mechanisms. Any new tracing hooks need to fit in with what exists already.
Correct, this proposal was to introduce trace hooks that would run for all request (and connection) activities on an
So basically I want to propose a way to run
But I guess it is not possible to replace httptrace with the new mechanism as it is a part of the go library. And adding the remaining new hooks with an entirely new mechanism would leave us with two different mechanisms as you mentioned.
Parts of the proposal that still fits into what exists already are per-request hooks that can be added to
PS. This is not a part of this proposal but the above hooks would also enable us to track the request's waiting time in i) getting a connection, ii) idleConnWait, and iii) connsPerHostWait. This could be done by adding a field