diff --git a/common/httpapi.go b/common/httpapi.go index bf634ff4a..3f2a75b6e 100644 --- a/common/httpapi.go +++ b/common/httpapi.go @@ -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. diff --git a/mediaapi/routing/routing.go b/mediaapi/routing/routing.go index 5bcce1772..e392c5711 100644 --- a/mediaapi/routing/routing.go +++ b/mediaapi/routing/routing.go @@ -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