Skip to content

Commit

Permalink
Fix compile error (#39)
Browse files Browse the repository at this point in the history
./nginx_exporter.go:186:32: undefined: prometheus.Handler
  • Loading branch information
zipkid authored and discordianfish committed Dec 10, 2019
1 parent fcc4ff9 commit 0f9a689
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion nginx_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"sync"

"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"
"github.com/prometheus/common/log"
)

Expand Down Expand Up @@ -183,7 +184,7 @@ func main() {
prometheus.MustRegister(exporter)

log.Infof("Starting Server: %s", *listeningAddress)
http.Handle(*metricsEndpoint, prometheus.Handler())
http.Handle(*metricsEndpoint, promhttp.Handler())
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
w.Write([]byte(`<html>
<head><title>Nginx Exporter</title></head>
Expand Down

0 comments on commit 0f9a689

Please sign in to comment.