update /metrics handler to promhttp.Handler()
This commit is contained in:
parent
f870fc3254
commit
4c70969940
|
@ -21,10 +21,10 @@ import (
|
|||
"net/http"
|
||||
"sync"
|
||||
|
||||
"github.com/digitalocean/ceph_exporter/collectors"
|
||||
|
||||
"github.com/ceph/go-ceph/rados"
|
||||
"github.com/digitalocean/ceph_exporter/collectors"
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
"github.com/prometheus/client_golang/prometheus/promhttp"
|
||||
)
|
||||
|
||||
// CephExporter wraps all the ceph collectors and provides a single global
|
||||
|
@ -140,7 +140,7 @@ func main() {
|
|||
prometheus.MustRegister(NewCephExporter(conn, "ceph"))
|
||||
}
|
||||
|
||||
http.Handle(*metricsPath, prometheus.Handler())
|
||||
http.Handle(*metricsPath, promhttp.Handler())
|
||||
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
|
||||
w.Write([]byte(`<html>
|
||||
<head><title>Ceph Exporter</title></head>
|
||||
|
|
Loading…
Reference in New Issue