Skip to content

Commit

Permalink
Merge pull request kumina#12 from kumina/fix_prom_handler
Browse files Browse the repository at this point in the history
Prom httphandler fix.
  • Loading branch information
BartVerc authored Jul 9, 2019
2 parents 859caa1 + 685fc29 commit 7ef7911
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion dovecot_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
"strings"

"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"
"gopkg.in/alecthomas/kingpin.v2"
)

Expand Down Expand Up @@ -216,7 +217,7 @@ func main() {
exporter := NewDovecotExporter(*socketPath, strings.Split(*dovecotScopes, ","))
prometheus.MustRegister(exporter)

http.Handle(*metricsPath, prometheus.Handler())
http.Handle(*metricsPath, promhttp.Handler())
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
w.Write([]byte(`
<html>
Expand Down

0 comments on commit 7ef7911

Please sign in to comment.