X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/d63d7dc79ed74beaaceda15ca88344de12258da3..b84947c1681c49ef1c1e9c29d1d19825c8868500:/services/keepstore/handlers.go diff --git a/services/keepstore/handlers.go b/services/keepstore/handlers.go index 8b37b906eb..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. @@ -547,7 +541,7 @@ func PullHandler(resp http.ResponseWriter, req *http.Request) { pullq.ReplaceQueue(plist) } -// TrashRequest consists of a block locator and it's Mtime +// TrashRequest consists of a block locator and its Mtime type TrashRequest struct { Locator string `json:"locator"` BlockMtime int64 `json:"block_mtime"`