diff --git a/proxy/httpproxy/metrics.go b/proxy/httpproxy/metrics.go index f71258cba57b..fcbedc28a888 100644 --- a/proxy/httpproxy/metrics.go +++ b/proxy/httpproxy/metrics.go @@ -47,13 +47,15 @@ var ( Help: "Counter of requests dropped on the proxy.", }, []string{"method", "proxying_error"}) - requestsHandlingTime = prometheus.NewHistogramVec( + requestsHandlingSec = prometheus.NewHistogramVec( prometheus.HistogramOpts{ Namespace: "etcd", Subsystem: "proxy", Name: "handling_duration_seconds", - Help: "Bucketed histogram of handling time of successful events (non-watches), by method " + - "(GET/PUT etc.).", + Help: "Bucketed histogram of handling time of successful events (non-watches), by method (GET/PUT etc.).", + + // lowest bucket start of upper bound 0.0005 sec (0.5 ms) with factor 2 + // highest bucket start of 0.0005 sec * 2^12 == 2.048 sec Buckets: prometheus.ExponentialBuckets(0.0005, 2, 13), }, []string{"method"}) ) @@ -70,7 +72,7 @@ func init() { prometheus.MustRegister(requestsIncoming) prometheus.MustRegister(requestsHandled) prometheus.MustRegister(requestsDropped) - prometheus.MustRegister(requestsHandlingTime) + prometheus.MustRegister(requestsHandlingSec) } func reportIncomingRequest(request *http.Request) { @@ -80,7 +82,7 @@ func reportIncomingRequest(request *http.Request) { func reportRequestHandled(request *http.Request, response *http.Response, startTime time.Time) { method := request.Method requestsHandled.WithLabelValues(method, strconv.Itoa(response.StatusCode)).Inc() - requestsHandlingTime.WithLabelValues(method).Observe(time.Since(startTime).Seconds()) + requestsHandlingSec.WithLabelValues(method).Observe(time.Since(startTime).Seconds()) } func reportRequestDropped(request *http.Request, err forwardingError) {