Alerting: Send merged configuration to the remote alertmanager (#107004)
This commit is contained in:
@@ -477,6 +477,17 @@ func CreateGrafDir(t *testing.T, opts GrafanaOpts) (string, string) {
|
||||
_, err = grafanaComSection.NewKey("api_url", opts.GrafanaComAPIURL)
|
||||
require.NoError(t, err)
|
||||
}
|
||||
|
||||
if opts.RemoteAlertmanagerURL != "" {
|
||||
remoteAlertmanagerSection, err := getOrCreateSection("remote.alertmanager")
|
||||
require.NoError(t, err)
|
||||
_, err = remoteAlertmanagerSection.NewKey("enabled", "true")
|
||||
require.NoError(t, err)
|
||||
_, err = remoteAlertmanagerSection.NewKey("url", opts.RemoteAlertmanagerURL)
|
||||
require.NoError(t, err)
|
||||
_, err = remoteAlertmanagerSection.NewKey("tenant", "1")
|
||||
require.NoError(t, err)
|
||||
}
|
||||
if opts.GrafanaComSSOAPIToken != "" {
|
||||
grafanaComSection, err := getOrCreateSection("grafana_com")
|
||||
require.NoError(t, err)
|
||||
@@ -571,6 +582,9 @@ type GrafanaOpts struct {
|
||||
|
||||
// When "unified-grpc" is selected it will also start the grpc server
|
||||
APIServerStorageType options.StorageType
|
||||
|
||||
// Remote alertmanager configuration
|
||||
RemoteAlertmanagerURL string
|
||||
}
|
||||
|
||||
func CreateUser(t *testing.T, store db.DB, cfg *setting.Cfg, cmd user.CreateUserCommand) *user.User {
|
||||
|
||||
Reference in New Issue
Block a user