From b0d209ef89d5b8427e6c405331978a7877fee6bf Mon Sep 17 00:00:00 2001 From: Markus Blaschke Date: Thu, 25 Mar 2021 22:36:15 +0100 Subject: [PATCH] add /healthz endpoint Signed-off-by: Markus Blaschke --- main.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/main.go b/main.go index 29c74c3..bd5932c 100644 --- a/main.go +++ b/main.go @@ -214,6 +214,13 @@ func initAzureConnection() { // start and handle prometheus handler func startHttpServer() { + // healthz + http.HandleFunc("/healthz", func(w http.ResponseWriter, r *http.Request) { + if _, err := fmt.Fprint(w, "Ok"); err != nil { + log.Error(err) + } + }) + http.Handle("/metrics", promhttp.Handler()) log.Fatal(http.ListenAndServe(opts.ServerBind, nil)) }