From c3e472dbc026ab9b239ec355ea7291e1a6e7837e Mon Sep 17 00:00:00 2001 From: Andrew Huang Date: Mon, 16 Apr 2018 14:34:56 -0700 Subject: [PATCH] Add routernode basic healthcheck endpoint --- routernode/httpapi.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/routernode/httpapi.go b/routernode/httpapi.go index 3280332..801f244 100644 --- a/routernode/httpapi.go +++ b/routernode/httpapi.go @@ -50,6 +50,10 @@ func (h *HTTPApi) Start(router *httprouter.Router) { router.GET("/v1/debug/pprof/symbol", wrapHandler(http.HandlerFunc(pprof.Symbol))) router.GET("/v1/debug/pprof/trace", wrapHandler(http.HandlerFunc(pprof.Trace))) + // Basic healthcheck endpoint + // TODO: add more introspection? + router.GET("/v1/healthcheck", httputil.LoggingHandler(h.healthcheck)) + // TODO: wrap a different registry (if we ever want more than one per process) router.GET("/metrics", wrapHandler(promhandler.Handler(h.routerNode.registry))) } @@ -155,3 +159,6 @@ func (h *HTTPApi) rawQueryHandler(w http.ResponseWriter, r *http.Request, ps htt } } } + +func (h *HTTPApi) healthcheck(w http.ResponseWriter, r *http.Request, ps httprouter.Params) { +}