Switched from InstrumentHandler to InstrumentHandlerDuration

This commit is contained in:
Pushpam Choudhary 2019-12-04 22:37:36 +05:30
parent 7cb71cc957
commit 59c5a06097
2 changed files with 2 additions and 2 deletions

View file

@ -59,7 +59,7 @@ func MakeHTMLAPI(metricsName string, f func(http.ResponseWriter, *http.Request)
}
}
return prometheus.InstrumentHandler(metricsName, http.HandlerFunc(withSpan))
return prometheus.InstrumentHandlerDuration(metricsName, http.HandlerFunc(withSpan))
}
// MakeInternalAPI turns a util.JSONRequestHandler function into an http.Handler.

View file

@ -83,7 +83,7 @@ func makeDownloadAPI(
activeRemoteRequests *types.ActiveRemoteRequests,
activeThumbnailGeneration *types.ActiveThumbnailGeneration,
) http.HandlerFunc {
return prometheus.InstrumentHandler(name, http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
return prometheus.InstrumentHandlerDuration(name, http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
req = util.RequestWithLogging(req)
// Set common headers returned regardless of the outcome of the request