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