diff --git a/.travis.yml b/.travis.yml index e7841fc..dac9203 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,6 +2,7 @@ language: go go: - "1.11" + - "1.12" before_install: - GO111MODULE=on go mod vendor diff --git a/http.go b/http.go index c1d2b8a..1d2f598 100644 --- a/http.go +++ b/http.go @@ -45,7 +45,9 @@ func listenHTTP(ctx context.Context, log plog.Logger) { mux := http.NewServeMux() mux.Handle("/metrics", promhttp.Handler()) - log.Info("listening for stats on http://" + *httpListenAddress) + mux.HandleFunc("/health", func(w http.ResponseWriter, r *http.Request) { + fmt.Fprintf(w, "ok") + }) // Instrument the handlers with all the metrics, injecting the "handler" // label by currying. @@ -67,5 +69,6 @@ func listenHTTP(ctx context.Context, log plog.Logger) { cancel() }() + log.Info("listening for stats on http://" + *httpListenAddress) log.Fatal(server.ListenAndServe()) }