cli: Replace deprecated function for getting Prometheus handler (#281)
This commit is contained in:
parent
05d9a0ba98
commit
c48512798e
|
@ -7,6 +7,7 @@ import (
|
||||||
"github.com/tus/tusd/prometheuscollector"
|
"github.com/tus/tusd/prometheuscollector"
|
||||||
|
|
||||||
"github.com/prometheus/client_golang/prometheus"
|
"github.com/prometheus/client_golang/prometheus"
|
||||||
|
"github.com/prometheus/client_golang/prometheus/promhttp"
|
||||||
)
|
)
|
||||||
|
|
||||||
var MetricsOpenConnections = prometheus.NewGauge(prometheus.GaugeOpts{
|
var MetricsOpenConnections = prometheus.NewGauge(prometheus.GaugeOpts{
|
||||||
|
@ -28,5 +29,5 @@ func SetupMetrics(handler *tusd.Handler) {
|
||||||
prometheus.MustRegister(prometheuscollector.New(handler.Metrics))
|
prometheus.MustRegister(prometheuscollector.New(handler.Metrics))
|
||||||
|
|
||||||
stdout.Printf("Using %s as the metrics path.\n", Flags.MetricsPath)
|
stdout.Printf("Using %s as the metrics path.\n", Flags.MetricsPath)
|
||||||
http.Handle(Flags.MetricsPath, prometheus.Handler())
|
http.Handle(Flags.MetricsPath, promhttp.Handler())
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue