Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
# should also be updated.
container:

image: quay.io/prometheus/golang-builder:1.25-base
image: quay.io/prometheus/golang-builder:1.26-base
services:
maildev-noauth:
image: maildev/maildev:2.2.1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/mixin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: install Go
uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
with:
go-version: 1.25.x
go-version: 1.26.x
# pin the mixtool version until https://github.com/monitoring-mixins/mixtool/issues/135 is merged.
- run: go install github.com/monitoring-mixins/mixtool/cmd/mixtool@2282201396b69055bb0f92f187049027a16d2130
- run: go install github.com/google/go-jsonnet/cmd/jsonnetfmt@latest
Expand Down
2 changes: 1 addition & 1 deletion .promu.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
go:
# Whenever the Go version is updated here,
# .circle/config.yml should also be updated.
version: 1.25
version: 1.26
repository:
path: github.com/prometheus/alertmanager
build:
Expand Down
6 changes: 2 additions & 4 deletions cli/silence_import.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,9 @@ func (c *silenceImportCmd) bulkImport(ctx context.Context, _ *kingpin.ParseConte
}
defer closeChannels()
for w := 0; w < c.workers; w++ {
wg.Add(1)
go func() {
wg.Go(func() {
addSilenceWorker(ctx, amclient.Silence, silencec, errc)
wg.Done()
}()
})
}

errCount := 0
Expand Down
6 changes: 2 additions & 4 deletions cluster/tls_transport_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,11 +210,9 @@ func TestDialTimeout(t *testing.T) {

var to net.Conn
var wg sync.WaitGroup
wg.Add(1)
go func() {
wg.Go(func() {
to = <-t2.StreamCh()
wg.Done()
}()
})

sent := []byte(("test stream"))
m, err := from.Write(sent)
Expand Down
12 changes: 4 additions & 8 deletions cmd/alertmanager/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -287,11 +287,9 @@ func run() int {
notificationLog.SetBroadcast(c.Broadcast)
}

wg.Add(1)
go func() {
wg.Go(func() {
notificationLog.Maintenance(*maintenanceInterval, filepath.Join(*dataDir, "nflog"), stopc, nil)
wg.Done()
}()
})

marker := types.NewMarker(prometheus.DefaultRegisterer)

Expand All @@ -317,11 +315,9 @@ func run() int {
}

// Start providers before router potentially sends updates.
wg.Add(1)
go func() {
wg.Go(func() {
silences.Maintenance(*maintenanceInterval, filepath.Join(*dataDir, "silences"), stopc, nil)
wg.Done()
}()
})

defer func() {
close(stopc)
Expand Down
12 changes: 4 additions & 8 deletions dispatch/dispatch.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,7 @@ func (d *Dispatcher) run(it provider.AlertIterator) {
defer it.Close()

// Start maintenance goroutine
d.finished.Add(1)
go func() {
defer d.finished.Done()
d.finished.Go(func() {
ticker := time.NewTicker(d.maintenanceInterval)
defer ticker.Stop()

Expand All @@ -214,12 +212,10 @@ func (d *Dispatcher) run(it provider.AlertIterator) {
return
}
}
}()
})

// Start timer goroutine
d.finished.Add(1)
go func() {
defer d.finished.Done()
d.finished.Go(func() {
<-d.startTimer.C

if d.state.CompareAndSwap(DispatcherStateWaitingToStart, DispatcherStateRunning) {
Expand All @@ -232,7 +228,7 @@ func (d *Dispatcher) run(it provider.AlertIterator) {
})
}
}
}()
})

// Start multiple alert ingestion goroutines
alertCh := it.Next()
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/prometheus/alertmanager

go 1.24.0
go 1.25.0

require (
github.com/KimMachineGun/automemlimit v0.7.5
Expand Down
6 changes: 2 additions & 4 deletions nflog/nflog_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,14 +156,12 @@ func TestWithMaintenance_SupportsCustomCallback(t *testing.T) {
var calls atomic.Int32
var wg sync.WaitGroup

wg.Add(1)
go func() {
defer wg.Done()
wg.Go(func() {
l.Maintenance(100*time.Millisecond, f.Name(), stopc, func() (int64, error) {
calls.Add(1)
return 0, nil
})
}()
})
gosched()

// Before the first tick, no maintenance executed.
Expand Down
7 changes: 2 additions & 5 deletions provider/mem/mem_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -564,10 +564,7 @@ func TestAlertsConcurrently(t *testing.T) {
expire := 10 * time.Millisecond
wg := sync.WaitGroup{}
for range 100 {
wg.Add(1)
go func() {
defer wg.Done()

wg.Go(func() {
j := 0
for {
select {
Expand All @@ -592,7 +589,7 @@ func TestAlertsConcurrently(t *testing.T) {
}
j++
}
}()
})
}
wg.Wait()
select {
Expand Down
18 changes: 6 additions & 12 deletions silence/cache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,35 +157,29 @@ func TestCacheConcurrentAccess(t *testing.T) {

// Concurrent readers.
for range goroutines {
wg.Add(1)
go func() {
defer wg.Done()
wg.Go(func() {
for range 100 {
_ = c.get(fp)
}
}()
})
}

// Concurrent writers.
for i := range goroutines {
wg.Add(1)
go func() {
defer wg.Done()
wg.Go(func() {
for j := range 100 {
c.set(fp, newCacheEntry(i*100+j, "w"))
}
}()
})
}

// Concurrent deleters.
for range goroutines {
wg.Add(1)
go func() {
defer wg.Done()
wg.Go(func() {
for range 100 {
c.delete(fp)
}
}()
})
}

wg.Wait()
Expand Down
6 changes: 2 additions & 4 deletions silence/silence_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -553,14 +553,12 @@ func TestSilences_Maintenance_SupportsCustomCallback(t *testing.T) {
var calls atomic.Int32
var wg sync.WaitGroup

wg.Add(1)
go func() {
defer wg.Done()
wg.Go(func() {
s.Maintenance(10*time.Second, f.Name(), stopc, func() (int64, error) {
calls.Add(1)
return 0, nil
})
}()
})
gosched()

// Before the first tick, no maintenance executed.
Expand Down
6 changes: 2 additions & 4 deletions template/template_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -660,9 +660,7 @@ func TestTemplateFuncs(t *testing.T) {
t.Run(tc.title, func(t *testing.T) {
wg := sync.WaitGroup{}
for range 10 {
wg.Add(1)
go func() {
defer wg.Done()
wg.Go(func() {
got, err := tmpl.ExecuteTextString(tc.in, tc.data)
if tc.expErr == "" {
require.NoError(t, err)
Expand All @@ -671,7 +669,7 @@ func TestTemplateFuncs(t *testing.T) {
require.EqualError(t, err, tc.expErr)
require.Empty(t, got)
}
}()
})
}
wg.Wait()
})
Expand Down