Merge pull request #33 from Azanx/prometheusHandlerFix

replace prometheus.Handler with promhttp.Handler
This commit is contained in:
Tim Stoop 2019-07-25 13:59:41 +02:00 committed by GitHub
commit c43f4d9402
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -31,6 +31,7 @@ import (
"github.com/hpcloud/tail"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"
)
var (
@ -691,7 +692,7 @@ func main() {
}
prometheus.MustRegister(exporter)
http.Handle(*metricsPath, prometheus.Handler())
http.Handle(*metricsPath, promhttp.Handler())
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
_, err = w.Write([]byte(`
<html>