mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Alerting: Scheduler to drop ticks if a rule's evaluation is too slow (#48885)
* drop ticks if evaluation of a rule is too slow. * add metric schedule_rule_evaluations_missed_total
This commit is contained in:
@@ -56,6 +56,7 @@ type Scheduler struct {
|
||||
SchedulableAlertRulesHash prometheus.Gauge
|
||||
UpdateSchedulableAlertRulesDuration prometheus.Histogram
|
||||
Ticker *legacyMetrics.Ticker
|
||||
EvaluationMissed *prometheus.CounterVec
|
||||
}
|
||||
|
||||
type MultiOrgAlertmanager struct {
|
||||
@@ -199,6 +200,15 @@ func newSchedulerMetrics(r prometheus.Registerer) *Scheduler {
|
||||
},
|
||||
),
|
||||
Ticker: legacyMetrics.NewTickerMetrics(r),
|
||||
EvaluationMissed: promauto.With(r).NewCounterVec(
|
||||
prometheus.CounterOpts{
|
||||
Namespace: Namespace,
|
||||
Subsystem: Subsystem,
|
||||
Name: "schedule_rule_evaluations_missed_total",
|
||||
Help: "The total number of rule evaluations missed due to a slow rule evaluation.",
|
||||
},
|
||||
[]string{"org", "name"},
|
||||
),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user