mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-12-15 08:23:34 +01:00
lib/httpserver: sync the code with master branch
This commit is contained in:
parent
a045c62532
commit
05ec8afb3a
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user