Skip to content

Commit fce4af6

Browse files
Update prometheus/alertmanager to version v0.25.1-0.20230203120921-7923bc5f8ec6
Signed-off-by: Krishna Teja Puttagunta <[email protected]>
1 parent 398bd83 commit fce4af6

File tree

40 files changed

+2178
-404
lines changed

40 files changed

+2178
-404
lines changed

go.mod

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ require (
4242
github.com/opentracing-contrib/go-stdlib v1.0.0
4343
github.com/opentracing/opentracing-go v1.2.0
4444
github.com/pkg/errors v0.9.1
45-
github.com/prometheus/alertmanager v0.25.0
45+
github.com/prometheus/alertmanager v0.25.1-0.20230203120921-7923bc5f8ec6
4646
github.com/prometheus/client_golang v1.14.0
4747
github.com/prometheus/client_model v0.3.0
4848
github.com/prometheus/common v0.42.0
@@ -132,7 +132,7 @@ require (
132132
github.com/go-openapi/runtime v0.25.0 // indirect
133133
github.com/go-openapi/spec v0.20.8 // indirect
134134
github.com/go-openapi/validate v0.22.1 // indirect
135-
github.com/gofrs/uuid v4.3.1+incompatible // indirect
135+
github.com/gofrs/uuid v4.4.0+incompatible // indirect
136136
github.com/gogo/googleapis v1.4.0 // indirect
137137
github.com/golang-jwt/jwt/v4 v4.5.0 // indirect
138138
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
@@ -150,6 +150,7 @@ require (
150150
github.com/hashicorp/go-multierror v1.1.1 // indirect
151151
github.com/hashicorp/go-rootcerts v1.0.2 // indirect
152152
github.com/hashicorp/golang-lru v0.6.0 // indirect
153+
github.com/hashicorp/golang-lru/v2 v2.0.1 // indirect
153154
github.com/hashicorp/serf v0.10.1 // indirect
154155
github.com/jessevdk/go-flags v1.5.0 // indirect
155156
github.com/jmespath/go-jmespath v0.4.0 // indirect
@@ -179,7 +180,7 @@ require (
179180
github.com/prometheus/common/sigv4 v0.1.0 // indirect
180181
github.com/prometheus/exporter-toolkit v0.9.1 // indirect
181182
github.com/prometheus/procfs v0.9.0 // indirect
182-
github.com/rs/cors v1.8.2 // indirect
183+
github.com/rs/cors v1.8.3 // indirect
183184
github.com/rs/xid v1.4.0 // indirect
184185
github.com/rueian/rueidis v0.0.93 // indirect
185186
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 // indirect

go.sum

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1025,8 +1025,8 @@ github.com/godbus/dbus/v5 v5.0.6/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5x
10251025
github.com/gofrs/flock v0.8.1 h1:+gYjHKf32LDeiEEFhQaotPbLuUXjY5ZqxKgXy7n59aw=
10261026
github.com/gofrs/uuid v3.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM=
10271027
github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM=
1028-
github.com/gofrs/uuid v4.3.1+incompatible h1:0/KbAdpx3UXAx1kEOWHJeOkpbgRFGHVgv+CFIY7dBJI=
1029-
github.com/gofrs/uuid v4.3.1+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM=
1028+
github.com/gofrs/uuid v4.4.0+incompatible h1:3qXRTX8/NbyulANqlc0lchS1gqAVxRgsuW1YrTJupqA=
1029+
github.com/gofrs/uuid v4.4.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM=
10301030
github.com/gogo/googleapis v0.0.0-20180223154316-0cd9801be74a/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s=
10311031
github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s=
10321032
github.com/gogo/googleapis v1.2.0/go.mod h1:Njal3psf3qN6dwBtQfUmBZh2ybovJ0tlu3o/AC7HYjU=
@@ -1265,6 +1265,8 @@ github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ
12651265
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
12661266
github.com/hashicorp/golang-lru v0.6.0 h1:uL2shRDx7RTrOrTCUZEGP/wJUFiUI8QT6E7z5o8jga4=
12671267
github.com/hashicorp/golang-lru v0.6.0/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4=
1268+
github.com/hashicorp/golang-lru/v2 v2.0.1 h1:5pv5N1lT1fjLg2VQ5KWc7kmucp2x/kvFOnxuVTqZ6x4=
1269+
github.com/hashicorp/golang-lru/v2 v2.0.1/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM=
12681270
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
12691271
github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64=
12701272
github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ=
@@ -1674,8 +1676,8 @@ github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH
16741676
github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI=
16751677
github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s=
16761678
github.com/pquerna/cachecontrol v0.0.0-20171018203845-0dec1b30a021/go.mod h1:prYjPmNq4d1NPVmpShWobRqXY3q7Vp+80DqgxxUrUIA=
1677-
github.com/prometheus/alertmanager v0.25.0 h1:vbXKUR6PYRiZPRIKfmXaG+dmCKG52RtPL4Btl8hQGvg=
1678-
github.com/prometheus/alertmanager v0.25.0/go.mod h1:MEZ3rFVHqKZsw7IcNS/m4AWZeXThmJhumpiWR4eHU/w=
1679+
github.com/prometheus/alertmanager v0.25.1-0.20230203120921-7923bc5f8ec6 h1:8H3mLywTr2kPKGToZ4ssQYPdp6fjFSAaWNXJ/iHRZ4o=
1680+
github.com/prometheus/alertmanager v0.25.1-0.20230203120921-7923bc5f8ec6/go.mod h1:Dh8tgp3WxdXiGZ2RtSHnLMvAC2GO3cfOITuCraU8F3Q=
16791681
github.com/prometheus/client_golang v0.0.0-20180209125602-c332b6f63c06/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
16801682
github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
16811683
github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs=
@@ -1750,8 +1752,8 @@ github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFR
17501752
github.com/rogpeppe/go-internal v1.2.2/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
17511753
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
17521754
github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8=
1753-
github.com/rs/cors v1.8.2 h1:KCooALfAYGs415Cwu5ABvv9n9509fSiG5SQJn/AQo4U=
1754-
github.com/rs/cors v1.8.2/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU=
1755+
github.com/rs/cors v1.8.3 h1:O+qNyWn7Z+F9M0ILBHgMVPuB1xTOucVd5gtaYyXBpRo=
1756+
github.com/rs/cors v1.8.3/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU=
17551757
github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ=
17561758
github.com/rs/xid v1.4.0 h1:qd7wPTDkN6KQx2VmMBLrpHkiyQwgFXRnkOLacUiaSNY=
17571759
github.com/rs/xid v1.4.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=

pkg/alertmanager/alertmanager.go

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -192,20 +192,25 @@ func New(cfg *Config, reg *prometheus.Registry) (*Alertmanager, error) {
192192

193193
am.wg.Add(1)
194194
var err error
195-
am.nflog, err = nflog.New(
196-
nflog.WithRetention(cfg.Retention),
197-
nflog.WithSnapshot(filepath.Join(cfg.TenantDataDir, notificationLogSnapshot)),
198-
nflog.WithMaintenance(maintenancePeriod, am.stop, am.wg.Done, nil),
199-
nflog.WithMetrics(am.registry),
200-
nflog.WithLogger(log.With(am.logger, "component", "nflog")),
201-
)
195+
196+
am.nflog, err = nflog.New(nflog.Options{
197+
SnapshotFile: filepath.Join(cfg.TenantDataDir, notificationLogSnapshot),
198+
Retention: cfg.Retention,
199+
Logger: log.With(am.logger, "component", "nflog"),
200+
Metrics: am.registry,
201+
})
202+
202203
if err != nil {
203204
return nil, fmt.Errorf("failed to create notification log: %v", err)
204205
}
205206

206207
c := am.state.AddState("nfl:"+cfg.UserID, am.nflog, am.registry)
207208
am.nflog.SetBroadcast(c.Broadcast)
208-
209+
am.wg.Add(1)
210+
go func() {
211+
am.nflog.Maintenance(maintenancePeriod, filepath.Join(cfg.TenantDataDir, notificationLogSnapshot), am.stop, nil)
212+
am.wg.Done()
213+
}()
209214
am.marker = types.NewMarker(am.registry)
210215

211216
silencesFile := filepath.Join(cfg.TenantDataDir, silencesSnapshot)
@@ -320,7 +325,7 @@ func (am *Alertmanager) ApplyConfig(userID string, conf *config.Config, rawCfg s
320325
templateFiles[i] = templateFilepath
321326
}
322327

323-
tmpl, err := template.FromGlobs(templateFiles...)
328+
tmpl, err := template.FromGlobs(templateFiles)
324329
if err != nil {
325330
return err
326331
}
@@ -461,7 +466,7 @@ func (am *Alertmanager) getFullState() (*clusterpb.FullState, error) {
461466

462467
// buildIntegrationsMap builds a map of name to the list of integration notifiers off of a
463468
// list of receiver config.
464-
func buildIntegrationsMap(nc []*config.Receiver, tmpl *template.Template, firewallDialer *util_net.FirewallDialer, logger log.Logger, notifierWrapper func(string, notify.Notifier) notify.Notifier) (map[string][]notify.Integration, error) {
469+
func buildIntegrationsMap(nc []config.Receiver, tmpl *template.Template, firewallDialer *util_net.FirewallDialer, logger log.Logger, notifierWrapper func(string, notify.Notifier) notify.Notifier) (map[string][]notify.Integration, error) {
465470
integrationsMap := make(map[string][]notify.Integration, len(nc))
466471
for _, rcv := range nc {
467472
integrations, err := buildReceiverIntegrations(rcv, tmpl, firewallDialer, logger, notifierWrapper)
@@ -476,7 +481,7 @@ func buildIntegrationsMap(nc []*config.Receiver, tmpl *template.Template, firewa
476481
// buildReceiverIntegrations builds a list of integration notifiers off of a
477482
// receiver config.
478483
// Taken from https://github.com/prometheus/alertmanager/blob/94d875f1227b29abece661db1a68c001122d1da5/cmd/alertmanager/main.go#L112-L159.
479-
func buildReceiverIntegrations(nc *config.Receiver, tmpl *template.Template, firewallDialer *util_net.FirewallDialer, logger log.Logger, wrapper func(string, notify.Notifier) notify.Notifier) ([]notify.Integration, error) {
484+
func buildReceiverIntegrations(nc config.Receiver, tmpl *template.Template, firewallDialer *util_net.FirewallDialer, logger log.Logger, wrapper func(string, notify.Notifier) notify.Notifier) ([]notify.Integration, error) {
480485
var (
481486
errs types.MultiError
482487
integrations []notify.Integration

pkg/alertmanager/api.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ func validateUserConfig(logger log.Logger, cfg alertspb.AlertConfigDesc, limits
247247
templateFiles[i] = filepath.Join(userTempDir, t)
248248
}
249249

250-
_, err = template.FromGlobs(templateFiles...)
250+
_, err = template.FromGlobs(templateFiles)
251251
if err != nil {
252252
return err
253253
}

pkg/alertmanager/api_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -782,7 +782,7 @@ func TestValidateAlertmanagerConfig(t *testing.T) {
782782
},
783783
"struct containing *HTTPClientConfig as nested child within a slice": {
784784
input: config.Config{
785-
Receivers: []*config.Receiver{{
785+
Receivers: []config.Receiver{{
786786
Name: "test",
787787
WebhookConfigs: []*config.WebhookConfig{{
788788
HTTPConfig: &commoncfg.HTTPClientConfig{

pkg/alertmanager/multitenant.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -911,7 +911,7 @@ func (am *MultitenantAlertmanager) setConfig(cfg alertspb.AlertConfigDesc) error
911911
return err
912912
}
913913

914-
userAmConfig.Receivers[i].WebhookConfigs[j].URL = &amconfig.URL{URL: u}
914+
userAmConfig.Receivers[i].WebhookConfigs[j].URL = &amconfig.SecretURL{URL: u}
915915
}
916916
}
917917
}

vendor/github.com/gofrs/uuid/README.md

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)