chore: refactroing of code

Commenting code for enhancing readability
This commit is contained in:
Jonas Kaninda
2024-11-19 18:18:58 +01:00
parent c54ae4bd34
commit 1c0097d8e4
15 changed files with 117 additions and 86 deletions

View File

@@ -52,6 +52,7 @@ var HttpDuration = promauto.NewHistogramVec(prometheus.HistogramOpts{
Help: "Duration of HTTP requests.",
}, []string{"name", "path"})
// PrometheusMiddleware Prometheus http handler middleware, returns http.Handler
func (pr PrometheusRoute) PrometheusMiddleware(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
path := pr.Path