remove prometheus.DefaultRegisterer

This commit is contained in:
CatherineF-dev 2021-11-12 02:12:49 +00:00
parent 8290400e9c
commit 744785ee40

View File

@ -23,7 +23,6 @@ import (
"testing"
"time"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"
"github.com/stretchr/testify/assert"
@ -48,7 +47,7 @@ func TestRecordOperation(t *testing.T) {
prometheusURL := "http://" + l.Addr().String() + "/metrics"
mux := http.NewServeMux()
//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)
server := &http.Server{
Addr: l.Addr().String(),