Remote Alertmanager: Optionally merge remote state before starting the internal Alertmanager (#107710)
* Remote Alertmanager: Use the same struct for Grafana stat and Mimir full state * Alertmanager: Add methods to merge nflog and silences * update grafana/alerting version * make update-workspace * update mocks * remove unnecesary methods from the remote Alertmanager implementation, create separate StateMerger interface * (WIP) Remote Alertmanager: Optionally merge remote state before starting the internal Alertmanager * cleanup ngalert.go * restore defaults.ini * move state parsing logic to 'remote' package, clean up ngalert.go * remove GetBase, implement MegeNflog and MergeSilences * delete fmt.Println * FetchRemoteState -> GetRemoteState * UserGrafanaState -> UserState * remove duplicate clusterpb import * reorder MimirClient interface * use general getState() method for Grafana state and Mimir full state * remove unnecessary state merging methods from the Alertmanager interface * remove pullState field * reduce diff * add info log after merging * merge silences and nflog entries in the same method * merge the remote state in the forked AM * reduce diff * update remote AM mock * tests * make error more specific * typo
This commit is contained in:
@@ -1859,6 +1859,15 @@ var (
|
||||
Owner: grafanaDataProSquad,
|
||||
FrontendOnly: true,
|
||||
},
|
||||
{
|
||||
Name: "alertmanagerRemoteSecondaryWithRemoteState",
|
||||
Description: "Starts Grafana in remote secondary mode pulling the latest state from the remote Alertmanager to avoid duplicate notifications.",
|
||||
Stage: FeatureStageExperimental,
|
||||
Owner: grafanaAlertingSquad,
|
||||
HideFromAdminPage: true,
|
||||
HideFromDocs: true,
|
||||
Expression: "false",
|
||||
},
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
@@ -240,3 +240,4 @@ alertingNotificationHistory,experimental,@grafana/alerting-squad,false,false,fal
|
||||
pluginAssetProvider,experimental,@grafana/plugins-platform-backend,false,true,false
|
||||
unifiedStorageSearchDualReaderEnabled,experimental,@grafana/search-and-storage,false,false,false
|
||||
dashboardDsAdHocFiltering,experimental,@grafana/datapro,false,false,true
|
||||
alertmanagerRemoteSecondaryWithRemoteState,experimental,@grafana/alerting-squad,false,false,false
|
||||
|
||||
|
@@ -970,4 +970,8 @@ const (
|
||||
// FlagDashboardDsAdHocFiltering
|
||||
// Enables adhoc filtering support for the dashboard datasource
|
||||
FlagDashboardDsAdHocFiltering = "dashboardDsAdHocFiltering"
|
||||
|
||||
// FlagAlertmanagerRemoteSecondaryWithRemoteState
|
||||
// Starts Grafana in remote secondary mode pulling the latest state from the remote Alertmanager to avoid duplicate notifications.
|
||||
FlagAlertmanagerRemoteSecondaryWithRemoteState = "alertmanagerRemoteSecondaryWithRemoteState"
|
||||
)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user