diff options
author | Dave Henderson <dhenderson@gmail.com> | 2020-09-22 22:10:34 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-22 20:10:34 -0600 |
commit | f197cec7f3a599ca18807e7b7719ef7666cfdb70 (patch) | |
tree | 59561ce5893b6a9a6ef972285507e6c79dde42b6 /admin.go | |
parent | be6daa5fd46edc9f66a5129347482b38e22bf103 (diff) |
metrics: Always track method label in uppercase (#3742)
* metrics: Always track method label in uppercase
Signed-off-by: Dave Henderson <dhenderson@gmail.com>
* Just use strings.ToUpper for clarity
Signed-off-by: Dave Henderson <dhenderson@gmail.com>
Diffstat (limited to 'admin.go')
-rw-r--r-- | admin.go | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -36,7 +36,6 @@ import ( "time" "github.com/prometheus/client_golang/prometheus" - "github.com/prometheus/client_golang/prometheus/promhttp" "go.uber.org/zap" ) @@ -111,7 +110,7 @@ func (admin AdminConfig) newAdminHandler(addr NetworkAddress) adminHandler { addRouteWithMetrics := func(pattern string, handlerLabel string, h http.Handler) { labels := prometheus.Labels{"path": pattern, "handler": handlerLabel} - h = promhttp.InstrumentHandlerCounter( + h = instrumentHandlerCounter( adminMetrics.requestCount.MustCurryWith(labels), h, ) @@ -126,7 +125,7 @@ func (admin AdminConfig) newAdminHandler(addr NetworkAddress) adminHandler { labels := prometheus.Labels{ "path": pattern, "handler": handlerLabel, - "method": r.Method, + "method": strings.ToUpper(r.Method), } adminMetrics.requestErrors.With(labels).Inc() } |