Description
The standard library offers support for tracing details of the HTTP(s) connection state on requests via the httptrace.ClientTrace
structure.
I have implemented this in our service code such that the http.request
span includes the additional tags, for example:
Each of the numbers shown is the number of milliseconds consumed by a segment of the request cycle. I found it useful to discover the location of slow network connection establishment issues (spoiler: it was TLS not DNS that time!), verify the TLS cipher suites in use, and ascertain that connection pooling was working as expected.
My implementation is an http.RoundTripper
wrapper that sets up the trace context and annotates the current span. I was thinking it would be a useful addition to contrib/net/http
.
It could either be default behaviour (the overhead isn't high IMO), or it could be a RoundTripperOption
to WrapClient
.
I'm happy to contribute a PR for this feature, I'm looking for some confirmation it would be a welcome addition.