Alerting: Metric to count imported from Prometheus rules (#100847)

This commit is contained in:
Alexander Akhmetov
2025-03-05 14:02:28 +01:00
committed by GitHub
parent 2638de6aeb
commit d44728f4e5
9 changed files with 161 additions and 22 deletions
+1 -5
View File
@@ -215,11 +215,7 @@ func (f *RuleStore) ListAlertRules(_ context.Context, q *models.ListAlertRulesQu
continue
}
if q.ImportedPrometheusRule != nil {
hasOriginalRuleDefinition := r.PrometheusRuleDefinition() != ""
if *q.ImportedPrometheusRule && !hasOriginalRuleDefinition {
continue
}
if !*q.ImportedPrometheusRule && hasOriginalRuleDefinition {
if *q.ImportedPrometheusRule != r.ImportedFromPrometheus() {
continue
}
}