Skip to content

Commit

Permalink
Merge pull request kumina#33 from Azanx/prometheusHandlerFix
Browse files Browse the repository at this point in the history
replace prometheus.Handler with promhttp.Handler
  • Loading branch information
timstoop authored Jul 25, 2019
2 parents af6943b + 689aedf commit c43f4d9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion postfix_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import (

"github.com/hpcloud/tail"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"
)

var (
Expand Down Expand Up @@ -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>
Expand Down

0 comments on commit c43f4d9

Please sign in to comment.