Introduce metrics for a RoundTripper

Package promhttp provides metrics for round trippers: https://pkg.go.dev/github.com/prometheus/client_golang/prometheus/promhttp

It's useful for applications that perform HTTP requests themselves. For example, Gitlab Shell: gitlab-shell!574 (merged).

The code in this MR is inspired by the code for handlers. Unfortunately, similar parts couldn't be reused due to the naming of public structures (like HandlerFactoryOption). Extracting the common parts like buckets didn't seem to worth it as well.

Edited by Igor Drozdov

Merge request reports

Loading