grafana/pkg/services/ngalert/metrics
Alexander Akhmetov 149f02aebe
Alerting: Add rule_group label to grafana_alerting_rule_group_rules metric (#88289)
* Alerting: Add rule_group label to grafana_alerting_rule_group_rules metric (#62361)

* Alerting: Delete rule group metrics when the rule group is deleted

This commit addresses the issue where the GroupRules metric (a GaugeVec)
keeps its value and is not deleted when an alert rule is removed from the rule registry.
Previously, when an alert rule with orgID=1 was active, the metric was:

  grafana_alerting_rule_group_rules{org="1",state="active"} 1

However, after deleting this rule, subsequent calls to updateRulesMetrics
did not update the gauge value, causing the metric to incorrectly remain at 1.

The fix ensures that when updateRulesMetrics is called it
also deletes the group rule metrics with the corresponding label values if needed.
2024-08-13 13:27:23 +02:00
..
alertmanager.go Alerting: Support UTF-8 (#81512) 2024-02-06 08:33:47 +00:00
api.go Alerting: Refactor metrics/ngalert.go into seperate files (#62362) 2023-01-27 18:49:49 +00:00
historian.go Swap weaveworks/common utilities for equivalents in grafana/dskit (#80051) 2024-01-05 10:08:38 -06:00
multi_org_alertmanager.go Alerting: Add metric for inhibition rules (#81119) 2024-01-23 19:43:17 +00:00
ngalert.go Alerting: Implement Prometheus remote write for recording rules (#89189) 2024-06-25 17:23:42 +03:00
remote_alertmanager.go Alerting: Add metrics to the remote Alertmanager struct (#79835) 2024-01-10 11:18:24 +01:00
remote_writer.go Alerting: Implement Prometheus remote write for recording rules (#89189) 2024-06-25 17:23:42 +03:00
scheduler.go Alerting: Add rule_group label to grafana_alerting_rule_group_rules metric (#88289) 2024-08-13 13:27:23 +02:00
state.go Alerting: Add a feature flag to periodically save states (#80987) 2024-01-23 17:03:30 +01:00
util.go Chore: Fix goimports grouping in alerting (#62424) 2023-01-30 09:55:35 +01:00