Skip to content

Commit

Permalink
add /healthz endpoint
Browse files Browse the repository at this point in the history
Signed-off-by: Markus Blaschke <[email protected]>
  • Loading branch information
mblaschke committed Mar 25, 2021
1 parent ab13168 commit b0d209e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}

0 comments on commit b0d209e

Please sign in to comment.