diff --git a/cmd/pqlogd/main.go b/cmd/pqlogd/main.go index b48eb7c6ea9fee0bc398053e5d60835a0120c605..9336cf92832fcd3b4d85e14ef95290546c403814 100644 --- a/cmd/pqlogd/main.go +++ b/cmd/pqlogd/main.go @@ -4,6 +4,7 @@ import ( "context" "crypto/tls" "flag" + "io" "log" "net" "net/http" @@ -47,6 +48,7 @@ func main() { mux := http.NewServeMux() mux.Handle("/metrics", promhttp.Handler()) + mux.HandleFunc("/health", livenessHandler) src, err := uri.Source() if err != nil { @@ -133,6 +135,10 @@ func buildListener() (net.Listener, error) { return l, nil } +func livenessHandler(w http.ResponseWriter, _ *http.Request) { + io.WriteString(w, "OK") // nolint:errcheck +} + // Instrumentation. func instrumentedHandler(h http.Handler, name string, withRequestSize bool) http.Handler { labels := prometheus.Labels{"handler": name}