From cc18399e8dcfcb0c1fbd618ec9036a1bcd86733d Mon Sep 17 00:00:00 2001 From: Mark Sagi-Kazar Date: Tue, 27 Oct 2020 16:52:10 +0100 Subject: [PATCH] Accept a Registerer instead of a Registry in PrometheusMetricsBuilder Accepting a prometheus.Registerer allows using prometheus.DefaultRegisterer. Signed-off-by: Mark Sagi-Kazar --- components/metrics/builder.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/metrics/builder.go b/components/metrics/builder.go index 2540a9b9a..c70e4755a 100644 --- a/components/metrics/builder.go +++ b/components/metrics/builder.go @@ -7,7 +7,7 @@ import ( "github.com/prometheus/client_golang/prometheus" ) -func NewPrometheusMetricsBuilder(prometheusRegistry *prometheus.Registry, namespace string, subsystem string) PrometheusMetricsBuilder { +func NewPrometheusMetricsBuilder(prometheusRegistry prometheus.Registerer, namespace string, subsystem string) PrometheusMetricsBuilder { return PrometheusMetricsBuilder{ Namespace: namespace, Subsystem: subsystem, @@ -18,7 +18,7 @@ func NewPrometheusMetricsBuilder(prometheusRegistry *prometheus.Registry, namesp // PrometheusMetricsBuilder provides methods to decorate publishers, subscribers and handlers. type PrometheusMetricsBuilder struct { // PrometheusRegistry may be filled with a pre-existing Prometheus registry, or left empty for the default registry. - PrometheusRegistry *prometheus.Registry + PrometheusRegistry prometheus.Registerer Namespace string Subsystem string