mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-28 05:57:25 +00:00
remove prometheus.DefaultRegisterer
This commit is contained in:
parent
8290400e9c
commit
744785ee40
@ -23,7 +23,6 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/prometheus/client_golang/prometheus"
|
|
||||||
"github.com/prometheus/client_golang/prometheus/promhttp"
|
"github.com/prometheus/client_golang/prometheus/promhttp"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
|
|
||||||
@ -48,7 +47,7 @@ func TestRecordOperation(t *testing.T) {
|
|||||||
prometheusURL := "http://" + l.Addr().String() + "/metrics"
|
prometheusURL := "http://" + l.Addr().String() + "/metrics"
|
||||||
mux := http.NewServeMux()
|
mux := http.NewServeMux()
|
||||||
//lint:ignore SA1019 ignore deprecated warning until we move off of global registries
|
//lint:ignore SA1019 ignore deprecated warning until we move off of global registries
|
||||||
handler := promhttp.InstrumentMetricHandler(prometheus.DefaultRegisterer, promhttp.HandlerFor(registry, promhttp.HandlerOpts{}))
|
handler := promhttp.HandlerFor(registry, promhttp.HandlerOpts{})
|
||||||
mux.Handle("/metrics", handler)
|
mux.Handle("/metrics", handler)
|
||||||
server := &http.Server{
|
server := &http.Server{
|
||||||
Addr: l.Addr().String(),
|
Addr: l.Addr().String(),
|
||||||
|
Loading…
Reference in New Issue
Block a user