Alerting: Update imported prometheus alertmanager version. Backport (#56228) (#56430)

Version 0.24.0 has a few bugs that cause panics. We update here to the
latest commit on github.com/prometheus/alertmanager's main branch.

Panic Bugs:
https://github.com/prometheus/alertmanager/issues/2936
https://github.com/prometheus/alertmanager/issues/3064

(cherry picked from commit ce89624ca2)
This commit is contained in:
Joe Blubaugh
2022-10-07 14:00:45 +08:00
committed by GitHub
parent dc04e2589c
commit 84a6820fd8
6 changed files with 67 additions and 65 deletions
@@ -206,7 +206,7 @@ func newAlertmanager(ctx context.Context, orgID int64, cfg *setting.Cfg, store A
}()
// Initialize in-memory alerts
am.alerts, err = mem.NewAlerts(context.Background(), am.marker, memoryAlertsGCInterval, nil, am.logger)
am.alerts, err = mem.NewAlerts(context.Background(), am.marker, memoryAlertsGCInterval, nil, am.logger, m.Registerer)
if err != nil {
return nil, fmt.Errorf("unable to initialize the alert provider component of alerting: %w", err)
}
@@ -314,7 +314,7 @@ func TestPutAlert(t *testing.T) {
t.Run(c.title, func(t *testing.T) {
r := prometheus.NewRegistry()
am.marker = types.NewMarker(r)
am.alerts, err = mem.NewAlerts(context.Background(), am.marker, 15*time.Minute, nil, am.logger)
am.alerts, err = mem.NewAlerts(context.Background(), am.marker, 15*time.Minute, nil, am.logger, r)
require.NoError(t, err)
alerts := []*types.Alert{}
@@ -93,7 +93,7 @@ func TestTelegramNotifier(t *testing.T) {
},
expMsg: map[string]string{
"parse_mode": "html",
"text": strings.Repeat("1", 4096-3) + "...",
"text": strings.Repeat("1", 4096-1) + "…",
},
expMsgError: nil,
}, {
@@ -85,7 +85,7 @@ func NewMultiOrgAlertmanager(cfg *setting.Cfg, configStore AlertingStore, orgSto
true,
cfg.UnifiedAlerting.HAPushPullInterval,
cfg.UnifiedAlerting.HAGossipInterval,
cluster.DefaultTcpTimeout,
cluster.DefaultTCPTimeout,
cluster.DefaultProbeTimeout,
cluster.DefaultProbeInterval,
nil,