Skip to content

Commit

Permalink
Use updated Prometheus handler.
Browse files Browse the repository at this point in the history
  • Loading branch information
xperimental committed Oct 27, 2018
1 parent 69f1b5d commit af0f4f2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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)
Expand Down

0 comments on commit af0f4f2

Please sign in to comment.