Alerting: Metrics should have the label org instead of user (#39353) (#39365)

An user within Grafana has a completely different meaning. Multi-tenancy is done via Organizations as a top-level concept.

(cherry picked from commit 35e5bfce40)

Co-authored-by: gotjosh <josue@grafana.com>
This commit is contained in:
Grot (@grafanabot)
2021-09-17 18:52:54 +02:00
committed by GitHub
co-authored by gotjosh
parent ab5ec6e838
commit 6f52226c66
+4 -4
View File
@@ -129,7 +129,7 @@ func newSchedulerMetrics(r prometheus.Registerer) *Scheduler {
Name: "rule_evaluations_total",
Help: "The total number of rule evaluations.",
},
[]string{"user"},
[]string{"org"},
),
// TODO: once rule groups support multiple rules, consider partitioning
// on rule group as well as tenant, similar to loki|cortex.
@@ -140,7 +140,7 @@ func newSchedulerMetrics(r prometheus.Registerer) *Scheduler {
Name: "rule_evaluation_failures_total",
Help: "The total number of rule evaluation failures.",
},
[]string{"user"},
[]string{"org"},
),
EvalDuration: promauto.With(r).NewSummaryVec(
prometheus.SummaryOpts{
@@ -150,7 +150,7 @@ func newSchedulerMetrics(r prometheus.Registerer) *Scheduler {
Help: "The duration for a rule to execute.",
Objectives: map[float64]float64{0.5: 0.05, 0.9: 0.01, 0.99: 0.001},
},
[]string{"user"},
[]string{"org"},
),
}
}
@@ -166,7 +166,7 @@ func newStateMetrics(r prometheus.Registerer) *State {
Name: "rule_group_rules",
Help: "The number of rules.",
},
[]string{"user"},
[]string{"org"},
),
AlertState: promauto.With(r).NewGaugeVec(prometheus.GaugeOpts{
Namespace: Namespace,