Alerting: Remove feature toggle for custom recovery threshold (#104455)

This commit is contained in:
Gilles De Mey
2025-04-24 17:58:17 +02:00
committed by GitHub
parent 674fdd1d32
commit 109267ab03
13 changed files with 247 additions and 312 deletions
+2 -3
View File
@@ -13,7 +13,6 @@ import (
"github.com/grafana/grafana/pkg/expr/mathexp"
"github.com/grafana/grafana/pkg/expr/metrics"
"github.com/grafana/grafana/pkg/infra/tracing"
"github.com/grafana/grafana/pkg/services/featuremgmt"
"github.com/grafana/grafana/pkg/util"
)
@@ -131,7 +130,7 @@ type ConditionEvalJSON struct {
}
// UnmarshalResampleCommand creates a ResampleCMD from Grafana's frontend query.
func UnmarshalThresholdCommand(rn *rawNode, features featuremgmt.FeatureToggles) (Command, error) {
func UnmarshalThresholdCommand(rn *rawNode) (Command, error) {
cmdConfig := ThresholdCommandConfig{}
if err := json.Unmarshal(rn.QueryRaw, &cmdConfig); err != nil {
return nil, fmt.Errorf("failed to parse the threshold command: %w", err)
@@ -151,7 +150,7 @@ func UnmarshalThresholdCommand(rn *rawNode, features featuremgmt.FeatureToggles)
if err != nil {
return nil, fmt.Errorf("invalid condition: %w", err)
}
if firstCondition.UnloadEvaluator != nil && features.IsEnabledGlobally(featuremgmt.FlagRecoveryThreshold) {
if firstCondition.UnloadEvaluator != nil {
unloading, err := NewThresholdCommand(rn.RefID, referenceVar, firstCondition.UnloadEvaluator.Type, firstCondition.UnloadEvaluator.Params)
if err != nil {
return nil, fmt.Errorf("invalid unloadCondition: %w", err)