code: func traceRequest(req *http.Request) (*http.Request, *RequestTrace) {
  	trace := &RequestTrace{}
  	ct := &httptrace.ClientTrace{
  		GetConn: func(hostPort string) {
  			trace.mtx.Lock()
  			defer trace.mtx.Unlock()
  			if trace.final {
  				return
  			}
  			trace.ConnectStart = time.Now()
  		},
  		GotConn: func(info httptrace.GotConnInfo) {
  			trace.mtx.Lock()
  			defer trace.mtx.Unlock()
  			if trace.final {
  				return
  			}
  			trace.ConnectDone = time.Now()
  			trace.ReusedConn = info.Reused
  			trace.WasIdleConn = info.WasIdle
  		},
  		WroteHeaders: func() {
  			trace.mtx.Lock()
  			defer trace.mtx.Unlock()
  			if trace.final {
  				return
  			}
  			trace.HeadersWritten = time.Now()
  		},
  		WroteRequest: func(info httptrace.WroteRequestInfo) {
  			trace.mtx.Lock()
  			defer trace.mtx.Unlock()
  			if trace.final {
  				return
  			}
  			trace.BodyWritten = time.Now()
  		},
  		GotFirstResponseByte: func() {
  			trace.mtx.Lock()
  			defer trace.mtx.Unlock()
  			if trace.final {
  				return
  			}
  			trace.FirstByte = time.Now()
  		},
  	}
  	req = req.WithContext(httptrace.WithClientTrace(req.Context(), ct))
  	return req, trace
  }
docs: // traceRequest sets up request tracing and returns the modified
  // request.