Observability & Instrumentation #56
-
We are currently using a very thin wrapper around the standard http.Client and capture metrics using Prometheus for response times, errors, etc., when making outbound HTTP requests. The way we implemented it was by adding Before and After hooks into our wrapper type. Looking at this library, it looks like we'd need to implement the RoundTripper interface wrapper an http.Transport and do our instrumentation there and set the Transport on the builder. Is that a reasonable approach using this library? Curios if anyone else has taken a similar approach. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Using a If you have a snippet using Prometheus, it might be a good addition to the wiki. |
Beta Was this translation helpful? Give feedback.
-
I want to add this to requests soon. Something simple, just |
Beta Was this translation helpful? Give feedback.
I want to add this to requests soon. Something simple, just
func(base http.RoundTripper, fn func(req *http.Request, res *http.Response, err error, duration time.Duration)) Transport
that you can fill in the details for.