Skip to content

Introduce metrics for a RoundTripper

Igor Drozdov requested to merge id-metrics-round-tripper into master

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