9d1d0e72c2
- add new feature flag to support enabling the dispatcher sync timer on the alertmanager - this attempts to synchronize the flushes across HA nodes to decrease amount of duplicate notifications --------- Co-authored-by: Yuri Tseretyan <yuriy.tseretyan@grafana.com>
17 lines
524 B
Go
17 lines
524 B
Go
package notifier
|
|
|
|
import (
|
|
alertingNotify "github.com/grafana/alerting/notify"
|
|
"github.com/grafana/grafana/pkg/services/featuremgmt"
|
|
)
|
|
|
|
// GetDispatchTimer returns the appropriate dispatch timer based on feature toggles.
|
|
func GetDispatchTimer(features featuremgmt.FeatureToggles) (dt alertingNotify.DispatchTimer) {
|
|
//nolint:staticcheck // not yet migrated to OpenFeature
|
|
enabled := features.IsEnabledGlobally(featuremgmt.FlagAlertingSyncDispatchTimer)
|
|
if enabled {
|
|
dt = alertingNotify.DispatchTimerSync
|
|
}
|
|
return
|
|
}
|