X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/a8d73de4f59cf567a96f2f04be01a249d4f7c20b..b84947c1681c49ef1c1e9c29d1d19825c8868500:/services/keepstore/handlers.go diff --git a/services/keepstore/handlers.go b/services/keepstore/handlers.go index a84a84db3c..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(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.