lib/httpserver: sync the code with master branch

This commit is contained in:
Aliaksandr Valialkin 2019-12-18 23:08:22 +02:00
parent a045c62532
commit 05ec8afb3a

View File

@ -142,17 +142,17 @@ func handlerWrapper(w http.ResponseWriter, r *http.Request, rh RequestHandler) {
}
w.WriteHeader(status)
return
case "/metrics":
startTime := time.Now()
metricsRequests.Inc()
w.Header().Set("Content-Type", "text/plain")
writePrometheusMetrics(w)
metricsHandlerDuration.UpdateDuration(startTime)
return
case "/favicon.ico":
faviconRequests.Inc()
w.WriteHeader(http.StatusNoContent)
return
case "/metrics":
metricsRequests.Inc()
startTime := time.Now()
w.Header().Set("Content-Type", "text/plain")
writePrometheusMetrics(w)
metricsHandlerDuration.UpdateDuration(startTime)
return
default:
if strings.HasPrefix(r.URL.Path, "/debug/pprof/") {
pprofRequests.Inc()