Skip to content
This repository has been archived by the owner on Mar 12, 2021. It is now read-only.

Commit

Permalink
Replace prometheus.Handler by promhttp.Handler
Browse files Browse the repository at this point in the history
prometheus.Handler() is now deprecated and it needs to be replaced
by promhttp.Handler()
  • Loading branch information
chnyda committed Jun 20, 2019
1 parent 5b2f829 commit c774db1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion libvirt_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (

"github.com/libvirt/libvirt-go"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"
"gopkg.in/alecthomas/kingpin.v2"

"github.com/kumina/libvirt_exporter/libvirt_schema"
Expand Down Expand Up @@ -460,7 +461,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) {
w.Write([]byte(`
<html>
Expand Down

0 comments on commit c774db1

Please sign in to comment.