Skip to content
Open
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
44 changes: 0 additions & 44 deletions .github/workflows/golangci-lint.yml

This file was deleted.

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 buf.gen.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
version: v2
plugins:
- local: protoc-gen-go
- local: ['go', 'tool', '-modfile=internal/tools/go.mod', 'protoc-gen-go']
out: .
opt:
- module=github.com/prometheus/alertmanager
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
24 changes: 13 additions & 11 deletions internal/tools/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@ module github.com/prometheus/prometheus/internal/tools

go 1.25.0

require (
github.com/bufbuild/buf v1.65.0
github.com/go-swagger/go-swagger v0.33.1
golang.org/x/tools v0.41.0
google.golang.org/protobuf v1.36.11
tool (
github.com/bufbuild/buf/cmd/buf
github.com/go-swagger/go-swagger/cmd/swagger
google.golang.org/protobuf/cmd/protoc-gen-go
)

require (
Expand Down Expand Up @@ -35,6 +34,7 @@ require (
github.com/Microsoft/go-winio v0.6.2 // indirect
github.com/antlr4-go/antlr/v4 v4.13.1 // indirect
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
github.com/bufbuild/buf v1.65.0 // indirect
github.com/bufbuild/protocompile v0.14.2-0.20260130195850-5c64bed4577e // indirect
github.com/bufbuild/protoplugin v0.0.0-20250218205857-750e09ce93e1 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
Expand Down Expand Up @@ -66,13 +66,14 @@ require (
github.com/go-openapi/strfmt v0.23.0 // indirect
github.com/go-openapi/swag v0.23.1 // indirect
github.com/go-openapi/validate v0.24.0 // indirect
github.com/go-swagger/go-swagger v0.33.1 // indirect
github.com/go-viper/mapstructure/v2 v2.4.0 // indirect
github.com/gofrs/flock v0.13.0 // indirect
github.com/google/cel-go v0.27.0 // indirect
github.com/google/go-containerregistry v0.20.7 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/gorilla/handlers v1.5.2 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.7 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.28.0 // indirect
github.com/huandu/xstrings v1.5.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/jdx/go-netrc v1.0.0 // indirect
Expand Down Expand Up @@ -139,12 +140,13 @@ require (
golang.org/x/net v0.49.0 // indirect
golang.org/x/sync v0.19.0 // indirect
golang.org/x/sys v0.40.0 // indirect
golang.org/x/telemetry v0.0.0-20260109210033-bd525da824e2 // indirect
golang.org/x/term v0.39.0 // indirect
golang.org/x/text v0.33.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20260128011058-8636f8732409 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20260128011058-8636f8732409 // indirect
google.golang.org/grpc v1.78.0 // indirect
golang.org/x/text v0.34.0 // indirect
golang.org/x/tools v0.41.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20260209200024-4cfbd4190f57 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20260209200024-4cfbd4190f57 // indirect
google.golang.org/grpc v1.79.1 // indirect
google.golang.org/protobuf v1.36.11 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
mvdan.cc/xurls/v2 v2.6.0 // indirect
Expand Down
22 changes: 10 additions & 12 deletions internal/tools/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@ github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/gorilla/handlers v1.5.2 h1:cLTUSsNkgcwhgRqvCNmdbRWG0A3N4F+M2nWKdScwyEE=
github.com/gorilla/handlers v1.5.2/go.mod h1:dX+xVpaxdSw+q0Qek8SSsl3dfMk3jNddUkMzo0GtH0w=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.7 h1:X+2YciYSxvMQK0UZ7sg45ZVabVZBeBuvMkmuI2V3Fak=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.7/go.mod h1:lW34nIZuQ8UDPdkon5fmfp2l3+ZkQ2me/+oecHYLOII=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.28.0 h1:HWRh5R2+9EifMyIHV7ZV+MIZqgz+PMpZ14Jynv3O2Zs=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.28.0/go.mod h1:JfhWUomR1baixubs02l85lZYYOm7LV6om4ceouMv45c=
github.com/huandu/xstrings v1.5.0 h1:2ag3IFq9ZDANvthTwTiqSSZLjDc+BedvHPAp5tJy2TI=
github.com/huandu/xstrings v1.5.0/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE=
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
Expand Down Expand Up @@ -313,23 +313,21 @@ golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.40.0 h1:DBZZqJ2Rkml6QMQsZywtnjnnGvHza6BTfYFWY9kjEWQ=
golang.org/x/sys v0.40.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
golang.org/x/telemetry v0.0.0-20260109210033-bd525da824e2 h1:O1cMQHRfwNpDfDJerqRoE2oD+AFlyid87D40L/OkkJo=
golang.org/x/telemetry v0.0.0-20260109210033-bd525da824e2/go.mod h1:b7fPSJ0pKZ3ccUh8gnTONJxhn3c/PS6tyzQvyqw4iA8=
golang.org/x/term v0.39.0 h1:RclSuaJf32jOqZz74CkPA9qFuVTX7vhLlpfj/IGWlqY=
golang.org/x/term v0.39.0/go.mod h1:yxzUCTP/U+FzoxfdKmLaA0RV1WgE0VY7hXBwKtY/4ww=
golang.org/x/text v0.33.0 h1:B3njUFyqtHDUI5jMn1YIr5B0IE2U0qck04r6d4KPAxE=
golang.org/x/text v0.33.0/go.mod h1:LuMebE6+rBincTi9+xWTY8TztLzKHc/9C1uBCG27+q8=
golang.org/x/text v0.34.0 h1:oL/Qq0Kdaqxa1KbNeMKwQq0reLCCaFtqu2eNuSeNHbk=
golang.org/x/text v0.34.0/go.mod h1:homfLqTYRFyVYemLBFl5GgL/DWEiH5wcsQ5gSh1yziA=
golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac h1:7zkz7BUtwNFFqcowJ+RIgu2MaV/MapERkDIy+mwPyjs=
golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/tools v0.41.0 h1:a9b8iMweWG+S0OBnlU36rzLp20z1Rp10w+IY2czHTQc=
golang.org/x/tools v0.41.0/go.mod h1:XSY6eDqxVNiYgezAVqqCeihT4j1U2CCsqvH3WhQpnlg=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/genproto/googleapis/api v0.0.0-20260128011058-8636f8732409 h1:merA0rdPeUV3YIIfHHcH4qBkiQAc1nfCKSI7lB4cV2M=
google.golang.org/genproto/googleapis/api v0.0.0-20260128011058-8636f8732409/go.mod h1:fl8J1IvUjCilwZzQowmw2b7HQB2eAuYBabMXzWurF+I=
google.golang.org/genproto/googleapis/rpc v0.0.0-20260128011058-8636f8732409 h1:H86B94AW+VfJWDqFeEbBPhEtHzJwJfTbgE2lZa54ZAQ=
google.golang.org/genproto/googleapis/rpc v0.0.0-20260128011058-8636f8732409/go.mod h1:j9x/tPzZkyxcgEFkiKEEGxfvyumM01BEtsW8xzOahRQ=
google.golang.org/grpc v1.78.0 h1:K1XZG/yGDJnzMdd/uZHAkVqJE+xIDOcmdSFZkBUicNc=
google.golang.org/grpc v1.78.0/go.mod h1:I47qjTo4OKbMkjA/aOOwxDIiPSBofUtQUI5EfpWvW7U=
google.golang.org/genproto/googleapis/api v0.0.0-20260209200024-4cfbd4190f57 h1:JLQynH/LBHfCTSbDWl+py8C+Rg/k1OVH3xfcaiANuF0=
google.golang.org/genproto/googleapis/api v0.0.0-20260209200024-4cfbd4190f57/go.mod h1:kSJwQxqmFXeo79zOmbrALdflXQeAYcUbgS7PbpMknCY=
google.golang.org/genproto/googleapis/rpc v0.0.0-20260209200024-4cfbd4190f57 h1:mWPCjDEyshlQYzBpMNHaEof6UX1PmHcaUODUywQ0uac=
google.golang.org/genproto/googleapis/rpc v0.0.0-20260209200024-4cfbd4190f57/go.mod h1:j9x/tPzZkyxcgEFkiKEEGxfvyumM01BEtsW8xzOahRQ=
google.golang.org/grpc v1.79.1 h1:zGhSi45ODB9/p3VAawt9a+O/MULLl9dpizzNNpq7flY=
google.golang.org/grpc v1.79.1/go.mod h1:KmT0Kjez+0dde/v2j9vzwoAScgEPx/Bw1CYChhHLrHQ=
google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE=
google.golang.org/protobuf v1.36.11/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
Expand Down
25 changes: 0 additions & 25 deletions internal/tools/tools.go

This file was deleted.

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
11 changes: 2 additions & 9 deletions scripts/genproto.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,6 @@ if ! [[ "$0" = "scripts/genproto.sh" ]]; then
exit 255
fi

pushd "internal/tools" >/dev/null
INSTALL_PKGS="github.com/bufbuild/buf/cmd/buf google.golang.org/protobuf/cmd/protoc-gen-go"
for pkg in ${INSTALL_PKGS}; do
go install "$pkg"
done
popd >/dev/null

echo "generating files"
buf dep update
buf generate
go tool -modfile=internal/tools/go.mod buf dep update
go tool -modfile=internal/tools/go.mod buf generate
12 changes: 2 additions & 10 deletions scripts/swagger.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,7 @@ if ! [[ "$0" = "scripts/swagger.sh" ]]; then
exit 255
fi

FIRST_GOPATH=$(go env GOPATH | cut -d: -f1)

pushd "internal/tools" >/dev/null
go install "github.com/go-swagger/go-swagger/cmd/swagger"
popd >/dev/null

echo "generating files"
rm -r api/v2/{client,models,restapi} ||:
SWAGGER="${FIRST_GOPATH}/bin/swagger"
$SWAGGER generate server -f api/v2/openapi.yaml --copyright-file=COPYRIGHT.txt --exclude-main -A alertmanager --target api/v2/
$SWAGGER generate client -f api/v2/openapi.yaml --copyright-file=COPYRIGHT.txt --skip-models --target api/v2

go tool -modfile=internal/tools/go.mod swagger generate server -f api/v2/openapi.yaml --copyright-file=COPYRIGHT.txt --exclude-main -A alertmanager --target api/v2/
go tool -modfile=internal/tools/go.mod swagger generate client -f api/v2/openapi.yaml --copyright-file=COPYRIGHT.txt --skip-models --target api/v2
Loading