From: Mitja Adebahr Date: Thu, 25 Feb 2021 10:51:14 +0000 (+0100) Subject: Add health endpoint X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=70bce1afc97f4e10a48942eb81d73a535d68b213;p=blackbox_exporter.git 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 --- 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