actually register metrics this time (#34444)

This commit is contained in:
Owen Diehl 2021-05-19 16:09:12 -04:00 committed by GitHub
parent afbd4dec52
commit 8f350bc353
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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",