X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/911abf131639401b2ccfd23a6bc3ec983f7ed8f4..10c1e7359286edd6562c52304e9706449a9ee53f:/services/keepstore/handlers.go diff --git a/services/keepstore/handlers.go b/services/keepstore/handlers.go index fb327a386b..c31ab9c2e3 100644 --- a/services/keepstore/handlers.go +++ b/services/keepstore/handlers.go @@ -86,17 +86,11 @@ func MakeRESTRouter() http.Handler { // 400 Bad Request. rtr.NotFoundHandler = http.HandlerFunc(BadRequestHandler) - theConfig.metrics.setup() - rtr.limiter = httpserver.NewRequestLimiter(theConfig.MaxRequests, rtr) - mux := http.NewServeMux() - mux.Handle("/", theConfig.metrics.Instrument( - httpserver.AddRequestIDs(httpserver.LogRequests(nil, rtr.limiter)))) - mux.HandleFunc("/metrics.json", theConfig.metrics.exportJSON) - mux.Handle("/metrics", theConfig.metrics.exportProm) - - return mux + stack := httpserver.Instrument(nil, nil, + httpserver.AddRequestIDs(httpserver.LogRequests(nil, rtr.limiter))) + return stack.ServeAPI(stack) } // BadRequestHandler is a HandleFunc to address bad requests.