From af0f4f2b10223628c0f854c5945505f00f947a6d Mon Sep 17 00:00:00 2001 From: Robert Jacob Date: Sat, 27 Oct 2018 17:07:08 +0200 Subject: [PATCH] Use updated Prometheus handler. --- main.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 5851271..2b9ee49 100644 --- a/main.go +++ b/main.go @@ -7,6 +7,7 @@ import ( netatmo "github.com/exzz/netatmo-api-go" "github.com/prometheus/client_golang/prometheus" + "github.com/prometheus/client_golang/prometheus/promhttp" ) func main() { @@ -26,7 +27,7 @@ func main() { } prometheus.MustRegister(metrics) - http.Handle("/metrics", prometheus.UninstrumentedHandler()) + http.Handle("/metrics", promhttp.HandlerFor(prometheus.DefaultGatherer, promhttp.HandlerOpts{})) http.Handle("/", http.RedirectHandler("/metrics", http.StatusFound)) log.Printf("Listen on %s...", cfg.Addr)