Merge pull request #1159 from simonpasquier/add-healthy-probes

Add /-/healthy endpoint
This commit is contained in:
Frederic Branczyk 2018-01-08 11:25:16 +01:00 committed by GitHub
commit 0b5af7510b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -15,6 +15,7 @@ package ui
import (
"bytes"
"fmt"
"io"
"net/http"
_ "net/http/pprof" // Comment this line to disable pprof endpoint.
@ -76,6 +77,11 @@ func Register(r *route.Router, reloadCh chan<- struct{}, logger log.Logger) {
reloadCh <- struct{}{}
})
r.Get("/-/healthy", func(w http.ResponseWriter, _ *http.Request) {
w.WriteHeader(http.StatusOK)
fmt.Fprintf(w, "OK")
})
r.Get("/debug/*subpath", http.DefaultServeMux.ServeHTTP)
r.Post("/debug/*subpath", http.DefaultServeMux.ServeHTTP)
}