Alerting: Create metric for rules using simple notifications (#82904)

---------

Co-authored-by: Matthew Jacobson <matthew.jacobson@grafana.com>
This commit is contained in:
William Wernert
2024-02-16 12:01:49 -05:00
committed by GitHub
parent 3a63311286
commit fabaff9a24
2 changed files with 17 additions and 0 deletions

View File

@@ -20,6 +20,7 @@ type Scheduler struct {
EvalDuration *prometheus.HistogramVec
ProcessDuration *prometheus.HistogramVec
SendDuration *prometheus.HistogramVec
SimpleNotificationRules *prometheus.GaugeVec
GroupRules *prometheus.GaugeVec
Groups *prometheus.GaugeVec
SchedulePeriodicDuration prometheus.Histogram
@@ -91,6 +92,15 @@ func NewSchedulerMetrics(r prometheus.Registerer) *Scheduler {
},
[]string{"org"},
),
SimpleNotificationRules: promauto.With(r).NewGaugeVec(
prometheus.GaugeOpts{
Namespace: Namespace,
Subsystem: Subsystem,
Name: "simple_routing_rules",
Help: "The number of alert rules using simplified routing.",
},
[]string{"org"},
),
// TODO: partition on rule group as well as tenant, similar to loki|cortex.
GroupRules: promauto.With(r).NewGaugeVec(
prometheus.GaugeOpts{