server: add health endpoint to metrics listener There are already facilities to run the metrics listener on a fixed port, so this makes for a useful endpoint to have metrics and a health check in Kubernetes without exposing them to the world. In the long run, I would like to remove the metrics endpoint from the public listener, but that will take more work.
1 files changed, 3 insertions(+), 0 deletions(-) M server/server.go
M server/server.go => server/server.go +3 -0
@@ 438,6 438,9 @@ func (server *Server) Run() { mux := &http.ServeMux{} mux.Handle("/metrics", promhttp.Handler()) mux.HandleFunc("/healthz", func(w http.ResponseWriter, r *http.Request) { w.Write([]byte("OK")) }) pserver := &http.Server{Handler: mux} plisten, err := net.Listen("tcp", server.metricsAddr) if err != nil {