From aa88011352b67032c19b0c14eaa06b3417176753 Mon Sep 17 00:00:00 2001 From: ale <ale@incal.net> Date: Tue, 19 Dec 2017 17:20:40 +0000 Subject: [PATCH] Change names of the HTTP metrics to match other jobs --- serverutil/http.go | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/serverutil/http.go b/serverutil/http.go index 81c9ae9..7797ae6 100644 --- a/serverutil/http.go +++ b/serverutil/http.go @@ -103,16 +103,24 @@ func instrumentHandler(h http.Handler) http.Handler { // HTTP-related metrics. var ( + // Since we instrument the root HTTP handler, we don't really + // have a good way to set the 'handler' label based on the + // request URL - but still, we'd like to set the label to + // match what the other Prometheus jobs do. So we just set it + // to 'all'. totalRequests = prometheus.NewCounterVec( prometheus.CounterOpts{ - Name: "total_requests", + Name: "http_requests_total", Help: "Total number of requests.", + ConstLabels: prometheus.Labels{ + "handler": "all", + }, }, - []string{"code"}, + []string{"code", "method"}, ) inFlightRequests = prometheus.NewGauge( prometheus.GaugeOpts{ - Name: "inflight_requests", + Name: "http_requests_inflight", Help: "Number of in-flight requests.", }, ) -- GitLab