Skip to content

Commit 3640598

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 3640598

File tree

43 files changed

+2211
-296
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+2211
-296
lines changed

go.mod

Lines changed: 6 additions & 5 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
@@ -209,11 +210,11 @@ require (
209210
go4.org/unsafe/assume-no-moving-gc v0.0.0-20230221090011-e4bae7ad2296 // indirect
210211
golang.org/x/crypto v0.7.0 // indirect
211212
golang.org/x/exp v0.0.0-20230307190834-24139beb5833 // indirect
212-
golang.org/x/mod v0.9.0 // indirect
213+
golang.org/x/mod v0.10.0 // indirect
213214
golang.org/x/oauth2 v0.6.0 // indirect
214215
golang.org/x/sys v0.7.0 // indirect
215216
golang.org/x/text v0.9.0 // indirect
216-
golang.org/x/tools v0.7.0 // indirect
217+
golang.org/x/tools v0.8.0 // indirect
217218
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
218219
gonum.org/v1/gonum v0.12.0 // indirect
219220
google.golang.org/api v0.111.0 // indirect

go.sum

Lines changed: 12 additions & 10 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=
@@ -2131,8 +2133,8 @@ golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
21312133
golang.org/x/mod v0.5.0/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro=
21322134
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
21332135
golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
2134-
golang.org/x/mod v0.9.0 h1:KENHtAZL2y3NLMYZeHY9DW8HW8V+kQyJsY/V9JlKvCs=
2135-
golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
2136+
golang.org/x/mod v0.10.0 h1:lFO9qtOdlre5W1jxS3r/4szv2/6iXxScdzjoBMXNhYk=
2137+
golang.org/x/mod v0.10.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
21362138
golang.org/x/net v0.0.0-20180218175443-cbe0f9307d01/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
21372139
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
21382140
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
@@ -2541,8 +2543,8 @@ golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
25412543
golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
25422544
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
25432545
golang.org/x/tools v0.3.0/go.mod h1:/rWhSS2+zyEVwoJf8YAX6L2f0ntZ7Kn/mGgAWcipA5k=
2544-
golang.org/x/tools v0.7.0 h1:W4OVu8VVOaIO0yzWMNdepAulS7YfoS3Zabrm8DOXXU4=
2545-
golang.org/x/tools v0.7.0/go.mod h1:4pg6aUX35JBAogB10C9AtvVL+qowtN4pT3CGSQex14s=
2546+
golang.org/x/tools v0.8.0 h1:vSDcovVPld282ceKgDimkRSC8kpaH1dgyc9UMzlt84Y=
2547+
golang.org/x/tools v0.8.0/go.mod h1:JxBZ99ISMI5ViVkT1tr6tdNmXeTrcpVSD3vZ1RsRdN4=
25462548
golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
25472549
golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
25482550
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=

pkg/alertmanager/alertmanager.go

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

193193
am.wg.Add(1)
194194
var err error
195+
195196
am.nflog, err = nflog.New(
196197
nflog.WithRetention(cfg.Retention),
197198
nflog.WithSnapshot(filepath.Join(cfg.TenantDataDir, notificationLogSnapshot)),
198199
nflog.WithMaintenance(maintenancePeriod, am.stop, am.wg.Done, nil),
199200
nflog.WithMetrics(am.registry),
200201
nflog.WithLogger(log.With(am.logger, "component", "nflog")),
201202
)
203+
202204
if err != nil {
203205
return nil, fmt.Errorf("failed to create notification log: %v", err)
204206
}
205-
206207
c := am.state.AddState("nfl:"+cfg.UserID, am.nflog, am.registry)
207208
am.nflog.SetBroadcast(c.Broadcast)
208-
209209
am.marker = types.NewMarker(am.registry)
210210

211211
silencesFile := filepath.Join(cfg.TenantDataDir, silencesSnapshot)
@@ -218,10 +218,8 @@ func New(cfg *Config, reg *prometheus.Registry) (*Alertmanager, error) {
218218
if err != nil {
219219
return nil, fmt.Errorf("failed to create silences: %v", err)
220220
}
221-
222221
c = am.state.AddState("sil:"+cfg.UserID, am.silences, am.registry)
223222
am.silences.SetBroadcast(c.Broadcast)
224-
225223
// State replication needs to be started after the state keys are defined.
226224
if service, ok := am.state.(services.Service); ok {
227225
if err := service.StartAsync(context.Background()); err != nil {
@@ -320,7 +318,7 @@ func (am *Alertmanager) ApplyConfig(userID string, conf *config.Config, rawCfg s
320318
templateFiles[i] = templateFilepath
321319
}
322320

323-
tmpl, err := template.FromGlobs(templateFiles...)
321+
tmpl, err := template.FromGlobs(templateFiles)
324322
if err != nil {
325323
return err
326324
}
@@ -461,7 +459,7 @@ func (am *Alertmanager) getFullState() (*clusterpb.FullState, error) {
461459

462460
// buildIntegrationsMap builds a map of name to the list of integration notifiers off of a
463461
// 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) {
462+
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) {
465463
integrationsMap := make(map[string][]notify.Integration, len(nc))
466464
for _, rcv := range nc {
467465
integrations, err := buildReceiverIntegrations(rcv, tmpl, firewallDialer, logger, notifierWrapper)
@@ -476,7 +474,7 @@ func buildIntegrationsMap(nc []*config.Receiver, tmpl *template.Template, firewa
476474
// buildReceiverIntegrations builds a list of integration notifiers off of a
477475
// receiver config.
478476
// 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) {
477+
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) {
480478
var (
481479
errs types.MultiError
482480
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)