mirror of
https://github.com/grafana/grafana.git
synced 2025-01-09 23:53:25 -06:00
Alerting: Skip setting up clustering in remote primary/only modes (#88968)
* Alerting: Skip setting up clustering in remote primary mode * Update pkg/services/ngalert/notifier/multiorg_alertmanager.go Co-authored-by: Steve Simpson <steve.simpson@grafana.com> --------- Co-authored-by: Steve Simpson <steve.simpson@grafana.com>
This commit is contained in:
parent
35d0597367
commit
e15e40fbd3
@ -177,6 +177,7 @@ func (ng *AlertNG) init() error {
|
||||
ng.Log.Debug("Starting Grafana with remote only mode enabled")
|
||||
m := ng.Metrics.GetRemoteAlertmanagerMetrics()
|
||||
m.Info.WithLabelValues(metrics.ModeRemoteOnly).Set(1)
|
||||
ng.Cfg.UnifiedAlerting.SkipClustering = true
|
||||
|
||||
// This function will be used by the MOA to create new Alertmanagers.
|
||||
override := notifier.WithAlertmanagerOverride(func(_ notifier.OrgAlertmanagerFactory) notifier.OrgAlertmanagerFactory {
|
||||
@ -203,6 +204,7 @@ func (ng *AlertNG) init() error {
|
||||
|
||||
case remotePrimary:
|
||||
ng.Log.Warn("Only remote secondary mode is supported at the moment, falling back to remote secondary")
|
||||
// TODO: Skip setting up clustering with ng.Cfg.UnifiedAlerting.SkipClustering = true
|
||||
fallthrough
|
||||
|
||||
case remoteSecondary:
|
||||
|
@ -142,8 +142,12 @@ func NewMultiOrgAlertmanager(
|
||||
peer: &NilPeer{},
|
||||
}
|
||||
|
||||
if err := moa.setupClustering(cfg); err != nil {
|
||||
return nil, err
|
||||
if cfg.UnifiedAlerting.SkipClustering {
|
||||
l.Info("Skipping setting up clustering for MOA")
|
||||
} else {
|
||||
if err := moa.setupClustering(cfg); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
// Set up the default per tenant Alertmanager factory.
|
||||
|
@ -98,6 +98,7 @@ type UnifiedAlertingSettings struct {
|
||||
DefaultRuleEvaluationInterval time.Duration
|
||||
Screenshots UnifiedAlertingScreenshotSettings
|
||||
ReservedLabels UnifiedAlertingReservedLabelSettings
|
||||
SkipClustering bool
|
||||
StateHistory UnifiedAlertingStateHistorySettings
|
||||
RemoteAlertmanager RemoteAlertmanagerSettings
|
||||
// MaxStateSaveConcurrency controls the number of goroutines (per rule) that can save alert state in parallel.
|
||||
|
Loading…
Reference in New Issue
Block a user