Alerting: Remove feature toggle alertingNoNormalState (#99905)

This commit is contained in:
Yuri Tseretyan
2025-02-03 17:32:50 +02:00
committed by GitHub
parent f728b2df12
commit 807f94b2c7
16 changed files with 31 additions and 206 deletions
@@ -68,15 +68,10 @@ func (st ProtoInstanceDBStore) ListAlertInstances(ctx context.Context, cmd *mode
// Convert proto instances to model instances
for _, protoInstance := range instances {
modelInstance := alertInstanceProtoToModel(row.RuleUID, row.OrgID, protoInstance)
if modelInstance != nil {
// If FlagAlertingNoNormalState is enabled, we should not return instances with normal state and no reason.
if st.FeatureToggles.IsEnabled(ctx, featuremgmt.FlagAlertingNoNormalState) {
if modelInstance.CurrentState == models.InstanceStateNormal && modelInstance.CurrentReason == "" {
continue
}
}
alertInstances = append(alertInstances, modelInstance)
if modelInstance == nil {
continue
}
alertInstances = append(alertInstances, modelInstance)
}
}