Skip to content

Commit

Permalink
Accept a Registerer instead of a Registry in PrometheusMetricsBuilder (
Browse files Browse the repository at this point in the history
…#204)

Accepting a prometheus.Registerer allows using prometheus.DefaultRegisterer.

Signed-off-by: Mark Sagi-Kazar <mark.sagikazar@gmail.com>
  • Loading branch information
sagikazarmark authored Oct 27, 2020
1 parent 9982a54 commit 8fde3ce
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions components/metrics/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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
Expand Down

0 comments on commit 8fde3ce

Please # to comment.