mirror of
https://github.com/prometheus/prometheus.git
synced 2024-12-26 22:19:40 -08:00
Add metrics for rule evaluation failures.
Fixes https://github.com/prometheus/prometheus/issues/417
This commit is contained in:
parent
7aae5dd873
commit
9a4ca68a61
|
@ -49,6 +49,13 @@ var (
|
||||||
},
|
},
|
||||||
[]string{ruleTypeLabel},
|
[]string{ruleTypeLabel},
|
||||||
)
|
)
|
||||||
|
evalFailures = prometheus.NewCounter(
|
||||||
|
prometheus.CounterOpts{
|
||||||
|
Namespace: namespace,
|
||||||
|
Name: "rule_evaluation_failures_total",
|
||||||
|
Help: "The total number of rule evaluation failures.",
|
||||||
|
},
|
||||||
|
)
|
||||||
iterationDuration = prometheus.NewSummary(prometheus.SummaryOpts{
|
iterationDuration = prometheus.NewSummary(prometheus.SummaryOpts{
|
||||||
Namespace: namespace,
|
Namespace: namespace,
|
||||||
Name: "evaluator_duration_milliseconds",
|
Name: "evaluator_duration_milliseconds",
|
||||||
|
@ -59,6 +66,7 @@ var (
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
prometheus.MustRegister(iterationDuration)
|
prometheus.MustRegister(iterationDuration)
|
||||||
|
prometheus.MustRegister(evalFailures)
|
||||||
prometheus.MustRegister(evalDuration)
|
prometheus.MustRegister(evalDuration)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -229,6 +237,11 @@ func (m *ruleManager) runIteration(results chan<- *extraction.Result) {
|
||||||
Timestamp: s.Timestamp,
|
Timestamp: s.Timestamp,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
evalFailures.Inc()
|
||||||
|
}
|
||||||
|
|
||||||
m.results <- &extraction.Result{
|
m.results <- &extraction.Result{
|
||||||
Samples: samples,
|
Samples: samples,
|
||||||
Err: err,
|
Err: err,
|
||||||
|
|
Loading…
Reference in a new issue