TUN-2053: Add a /healthcheck endpoint to the metrics server

This commit is contained in:
Adam Chalmers
2019-11-12 16:55:40 -06:00
parent 759cd019be
commit c5af83af66
2 changed files with 5 additions and 0 deletions

View File

@@ -2,6 +2,7 @@ package metrics
import (
"context"
"fmt"
"net"
"net/http"
_ "net/http/pprof"
@@ -33,6 +34,9 @@ func ServeMetrics(l net.Listener, shutdownC <-chan struct{}, logger *logrus.Logg
}
http.Handle("/metrics", promhttp.Handler())
http.Handle("/healthcheck", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "OK\n")
}))
wg.Add(1)
go func() {