Alerting/ruler metrics (#34144)

* adds active configurations metric

* rule evaluation metrics

* ruler metrics

* pr feedback
This commit is contained in:
Owen Diehl
2021-05-14 16:13:44 -04:00
committed by GitHub
parent eb74994b8b
commit 1367f7171e
9 changed files with 99 additions and 26 deletions

View File

@@ -149,8 +149,9 @@ func (c *cache) trim() {
eval.Error: 0,
}
for _, org := range c.states {
for _, rule := range org {
for org, orgMap := range c.states {
c.metrics.GroupRules.WithLabelValues(fmt.Sprint(org)).Set(float64(len(orgMap)))
for _, rule := range orgMap {
for _, state := range rule {
if len(state.Results) > 100 {
newResults := make([]Evaluation, 100)