From 8f350bc353c8d36236c10930e61573a35bdb973b Mon Sep 17 00:00:00 2001 From: Owen Diehl Date: Wed, 19 May 2021 16:09:12 -0400 Subject: [PATCH] actually register metrics this time (#34444) --- pkg/services/ngalert/metrics/metrics.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/services/ngalert/metrics/metrics.go b/pkg/services/ngalert/metrics/metrics.go index 6e6a2035bf0..f0cdaca3f11 100644 --- a/pkg/services/ngalert/metrics/metrics.go +++ b/pkg/services/ngalert/metrics/metrics.go @@ -81,7 +81,7 @@ func NewMetrics(r prometheus.Registerer) *Metrics { }), // TODO: once rule groups support multiple rules, consider partitioning // on rule group as well as tenant, similar to loki|cortex. - EvalTotal: prometheus.NewCounterVec( + EvalTotal: promauto.With(r).NewCounterVec( prometheus.CounterOpts{ Namespace: "grafana", Subsystem: "alerting", @@ -92,7 +92,7 @@ func NewMetrics(r prometheus.Registerer) *Metrics { ), // TODO: once rule groups support multiple rules, consider partitioning // on rule group as well as tenant, similar to loki|cortex. - EvalFailures: prometheus.NewCounterVec( + EvalFailures: promauto.With(r).NewCounterVec( prometheus.CounterOpts{ Namespace: "grafana", Subsystem: "alerting", @@ -101,7 +101,7 @@ func NewMetrics(r prometheus.Registerer) *Metrics { }, []string{"user"}, ), - EvalDuration: prometheus.NewSummaryVec( + EvalDuration: promauto.With(r).NewSummaryVec( prometheus.SummaryOpts{ Namespace: "grafana", Subsystem: "alerting", @@ -113,7 +113,7 @@ func NewMetrics(r prometheus.Registerer) *Metrics { ), // TODO: once rule groups support multiple rules, consider partitioning // on rule group as well as tenant, similar to loki|cortex. - GroupRules: prometheus.NewGaugeVec( + GroupRules: promauto.With(r).NewGaugeVec( prometheus.GaugeOpts{ Namespace: "grafana", Subsystem: "alerting",