Alerting: Support Unified Alerting with Grafana HA (#37920) (#39342)

* Alerting: Support Unified Alerting in Grafana's HA mode.

(cherry picked from commit 7db97097c9)

Co-authored-by: gotjosh <josue@grafana.com>
This commit is contained in:
Grot (@grafanabot)
2021-09-17 08:23:51 -04:00
committed by GitHub
parent 499b1f4ff2
commit 8a369feb63
25 changed files with 6377 additions and 79 deletions
@@ -8,8 +8,6 @@ import (
"testing"
"time"
"github.com/grafana/grafana/pkg/services/ngalert/notifier"
"github.com/grafana/grafana/pkg/bus"
"github.com/grafana/grafana/pkg/models"
"github.com/grafana/grafana/pkg/services/ngalert/api/tooling/definitions"
@@ -19,16 +17,10 @@ import (
)
func TestAlertmanagerConfigurationIsTransactional(t *testing.T) {
// TODO: We need a reliable way to ensure Alertmanagers have synced correctly.
// For now, make them sync quicker.
p := notifier.SyncOrgsPollInterval
notifier.SyncOrgsPollInterval = 2 * time.Second
t.Cleanup(func() {
notifier.SyncOrgsPollInterval = p
})
dir, path := testinfra.CreateGrafDir(t, testinfra.GrafanaOpts{
EnableFeatureToggles: []string{"ngalert"},
DisableAnonymous: true,
EnableFeatureToggles: []string{"ngalert"},
NGAlertAlertmanagerConfigPollInterval: 2 * time.Second,
DisableAnonymous: true,
})
grafanaListedAddr, store := testinfra.StartGrafana(t, dir, path)