diff --git a/pkg/infra/metrics/service.go b/pkg/infra/metrics/service.go index 6b7f1d2354f..3a964dfc58f 100644 --- a/pkg/infra/metrics/service.go +++ b/pkg/infra/metrics/service.go @@ -66,7 +66,7 @@ func ProvideRegisterer() prometheus.Registerer { func ProvideGatherer() prometheus.Gatherer { k8sGatherer := newAddPrefixWrapper(legacyregistry.DefaultGatherer) - return newMultiRegistry(k8sGatherer, prometheus.DefaultGatherer) + return NewMultiRegistry(k8sGatherer, prometheus.DefaultGatherer) } func ProvideRegistererForTest() prometheus.Registerer { @@ -125,7 +125,7 @@ type multiRegistry struct { gatherers []prometheus.Gatherer } -func newMultiRegistry(gatherers ...prometheus.Gatherer) *multiRegistry { +func NewMultiRegistry(gatherers ...prometheus.Gatherer) *multiRegistry { return &multiRegistry{ gatherers: gatherers, } diff --git a/pkg/infra/metrics/service_test.go b/pkg/infra/metrics/service_test.go index af489a23965..6d32dde6480 100644 --- a/pkg/infra/metrics/service_test.go +++ b/pkg/infra/metrics/service_test.go @@ -51,7 +51,7 @@ func TestGathererPrefixWrapper_Gather(t *testing.T) { func TestMultiRegistry_Gather(t *testing.T) { one := &mockGatherer{} two := &mockGatherer{} - g := newMultiRegistry(one, two) + g := NewMultiRegistry(one, two) t.Run("should merge and sort metrics", func(t *testing.T) { one.GatherFunc = func() ([]*dto.MetricFamily, error) {