We currently use prometheus.DefaultRegisterer as the registerer for metrics we don't intend to collect. DefaultRegisterer simply calls NewRegistry() at compile time. In situations that create NewSignatureAggregators within the same application instance (such as Ginkgo test suites), this can cause the aggregator to fail with AlreadyRegisteredError.
How this works
Replaces DefaultRegisterer with NewRegistry() so that the no-op registry is created at runtime rather than compile time.
Why this should be merged
We currently use
prometheus.DefaultRegisterer
as the registerer for metrics we don't intend to collect.DefaultRegisterer
simply callsNewRegistry()
at compile time. In situations that createNewSignatureAggregator
s within the same application instance (such as Ginkgo test suites), this can cause the aggregator to fail withAlreadyRegisteredError
.How this works
Replaces
DefaultRegisterer
withNewRegistry()
so that the no-op registry is created at runtime rather than compile time.How this was tested
CI
How is this documented
N/A