From d02c4badf0f03426773d8c50c0833ac307aff485 Mon Sep 17 00:00:00 2001 From: lshep311 Date: Thu, 14 Mar 2019 16:27:28 -0700 Subject: [PATCH] Fix naming of metrics to remove service from name as the app name will be included with the metric --- middleware.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/middleware.go b/middleware.go index 3da9d76..121d73f 100644 --- a/middleware.go +++ b/middleware.go @@ -25,7 +25,7 @@ func NewMiddleware(name string, buckets ...float64) func(next http.Handler) http var m Middleware m.reqs = prometheus.NewCounterVec( prometheus.CounterOpts{ - Name: name + "_requests_total", + Name: "http_requests_total", Help: "How many HTTP requests processed, partitioned by status code, method and HTTP path.", ConstLabels: prometheus.Labels{"service": name}, }, @@ -37,7 +37,7 @@ func NewMiddleware(name string, buckets ...float64) func(next http.Handler) http buckets = dflBuckets } m.latency = prometheus.NewHistogramVec(prometheus.HistogramOpts{ - Name: name + "_duration_milliseconds", + Name: "http_request_duration_milliseconds", Help: "How long it took to process the request, partitioned by status code, method and HTTP path.", ConstLabels: prometheus.Labels{"service": name}, Buckets: buckets,