From 70bce1afc97f4e10a48942eb81d73a535d68b213 Mon Sep 17 00:00:00 2001 From: Mitja Adebahr Date: Thu, 25 Feb 2021 11:51:14 +0100 Subject: [PATCH] Add health endpoint The root endpoint exposes too much data. So it cannot be used as public health check endpoint. Signed-off-by: Mitja Adebahr --- main.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/main.go b/main.go index af1279d..f2294d7 100644 --- a/main.go +++ b/main.go @@ -309,6 +309,10 @@ func run() int { } }) http.Handle(path.Join(*routePrefix, "/metrics"), promhttp.Handler()) + http.HandleFunc(path.Join(*routePrefix, "/-/healthy"), func(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusOK) + w.Write([]byte("Healthy")) + }) http.HandleFunc(path.Join(*routePrefix, "/probe"), func(w http.ResponseWriter, r *http.Request) { sc.Lock() conf := sc.C -- 2.25.1