diff --git a/serverutil/http.go b/serverutil/http.go index 81c9ae902ff30237d3a45c33edb7ab12fa809c9a..7797ae66014d20d00625e91639f9a727a44c3e39 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.", }, )