httptrace is one of those packages that ships with Go that more people should know about. It's in net/http/httptrace and it gives you visibility into every phase of an HTTP request — DNS lookup, TCP connection, TLS handshake, and the actual request — without adding any external dependencies.
The setup
You attach a *httptrace.ClientTrace to a request context. Go calls the relevant hook as each phase completes. Here's a minimal example that just prints timestamps:
package main
import (









