From 9f2820ea1cc26a2aad761e2fe3b5c4c9795b3c71 Mon Sep 17 00:00:00 2001 From: marcel corso Date: Wed, 27 Mar 2019 14:03:58 +0100 Subject: [PATCH 1/2] add-simple-health-endpoint --- http.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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()) } From bb507db4a4389b8d51e0cdd820e5ece85bf68e7b Mon Sep 17 00:00:00 2001 From: marcel corso Date: Wed, 27 Mar 2019 14:05:18 +0100 Subject: [PATCH 2/2] go1.12 is here --- .travis.yml | 1 + 1 file changed, 1 insertion(+) 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