Skip to content

Commit c5f20b8

Browse files
Merge pull request #4299 from prometheus/grobinson/v0.28.1
Prepare Release 0.28.1
2 parents 4ce04fb + 53ba378 commit c5f20b8

File tree

25 files changed

+202
-65
lines changed

25 files changed

+202
-65
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ jobs:
2121
runs-on: ubuntu-latest
2222
strategy:
2323
matrix:
24-
thread: [ 0, 1, 2 ]
24+
thread: [0, 1, 2]
2525
steps:
2626
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
27-
- uses: prometheus/promci@3cb0c3871f223bd5ce1226995bd52ffb314798b6 # v0.1.0
27+
- uses: prometheus/promci@c3c93a50d581b928af720f0134b2b2dad32a6c41 # v0.4.6
2828
- uses: ./.github/promci/actions/build
2929
with:
3030
promu_opts: "-p linux/amd64 -p windows/amd64 -p linux/arm64 -p darwin/amd64 -p darwin/arm64 -p linux/386"
@@ -40,7 +40,7 @@ jobs:
4040
image: quay.io/prometheus/golang-builder:1.23-base
4141
steps:
4242
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
43-
- uses: prometheus/promci@3cb0c3871f223bd5ce1226995bd52ffb314798b6 # v0.1.0
43+
- uses: prometheus/promci@c3c93a50d581b928af720f0134b2b2dad32a6c41 # v0.4.6
4444
- uses: ./.github/promci/actions/setup_environment
4545
- run: make
4646
- run: git diff --exit-code

.github/workflows/publish.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ jobs:
1414
runs-on: ubuntu-latest
1515
strategy:
1616
matrix:
17-
thread: [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 ]
17+
thread: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
1818
needs: ci
1919
steps:
2020
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
21-
- uses: prometheus/promci@3cb0c3871f223bd5ce1226995bd52ffb314798b6 # v0.1.0
21+
- uses: prometheus/promci@c3c93a50d581b928af720f0134b2b2dad32a6c41 # v0.4.6
2222
- uses: ./.github/promci/actions/build
2323
with:
2424
parallelism: 12
@@ -29,7 +29,7 @@ jobs:
2929
needs: build
3030
steps:
3131
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
32-
- uses: prometheus/promci@3cb0c3871f223bd5ce1226995bd52ffb314798b6 # v0.1.0
32+
- uses: prometheus/promci@c3c93a50d581b928af720f0134b2b2dad32a6c41 # v0.4.6
3333
- uses: ./.github/promci/actions/publish_main
3434
with:
3535
docker_hub_login: ${{ secrets.docker_hub_login }}

.github/workflows/release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ jobs:
1414
runs-on: ubuntu-latest
1515
strategy:
1616
matrix:
17-
thread: [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 ]
17+
thread: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
1818
needs: ci
1919
steps:
2020
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
21-
- uses: prometheus/promci@3cb0c3871f223bd5ce1226995bd52ffb314798b6 # v0.1.0
21+
- uses: prometheus/promci@c3c93a50d581b928af720f0134b2b2dad32a6c41 # v0.4.6
2222
- uses: ./.github/promci/actions/build
2323
with:
2424
parallelism: 12
@@ -29,7 +29,7 @@ jobs:
2929
needs: build
3030
steps:
3131
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
32-
- uses: prometheus/promci@3cb0c3871f223bd5ce1226995bd52ffb314798b6 # v0.1.0
32+
- uses: prometheus/promci@c3c93a50d581b928af720f0134b2b2dad32a6c41 # v0.4.6
3333
- uses: ./.github/promci/actions/publish_release
3434
with:
3535
docker_hub_login: ${{ secrets.docker_hub_login }}

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
## 0.28.1 / 2025-03-07
2+
3+
* [ENHANCEMENT] Improved performance of inhibition rules when using Equal labels. #4119
4+
* [ENHANCEMENT] Improve the documentation on escaping in UTF-8 matchers. #4157
5+
* [ENHANCEMENT] Update alertmanager_config_hash metric help to document the hash is not cryptographically strong. #4157
6+
* [BUGFIX] Fix panic in amtool when using `--verbose`. #4218
7+
* [BUGFIX] Fix templating of channel field for Rocket.Chat. #4220
8+
* [BUGFIX] Fix `rocketchat_configs` written as `rocket_configs` in docs. #4217
9+
* [BUGFIX] Fix usage for `--enable-feature` flag. #4214
10+
* [BUGFIX] Trim whitespace from OpsGenie API Key. #4195
11+
* [BUGFIX] Fix Jira project template not rendered when searching for existing issues. #4291
12+
* [BUGFIX] Fix subtle bug in JSON/YAML encoding of inhibition rules that would cause Equal labels to be omitted. #4292
13+
* [BUGFIX] Fix header for `slack_configs` in docs. #4247
14+
* [BUGFIX] Fix weight and wrap of Microsoft Teams notifications. #4222
15+
* [BUGFIX] Fix format of YAML examples in configuration.md. #4207
16+
117
## 0.28.0 / 2025-01-15
218

319
* [CHANGE] Templating errors in the SNS integration now return an error. #3531 #3879

cli/root.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ var (
5252
func initMatchersCompat(_ *kingpin.ParseContext) error {
5353
promslogConfig := &promslog.Config{Writer: os.Stdout}
5454
if verbose {
55+
promslogConfig.Level = &promslog.AllowedLevel{}
5556
_ = promslogConfig.Level.Set("debug")
5657
}
5758
logger := promslog.New(promslogConfig)
@@ -155,7 +156,7 @@ func Execute() {
155156
app.Flag("timeout", "Timeout for the executed command").Default("30s").DurationVar(&timeout)
156157
app.Flag("http.config.file", "HTTP client configuration file for amtool to connect to Alertmanager.").PlaceHolder("<filename>").ExistingFileVar(&httpConfigFile)
157158
app.Flag("version-check", "Check alertmanager version. Use --no-version-check to disable.").Default("true").BoolVar(&versionCheck)
158-
app.Flag("enable-feature", fmt.Sprintf("Experimental features to enable. The flag can be repeated to enable multiple features. Valid options: %s", strings.Join(featurecontrol.AllowedFlags, ", "))).Default("").StringVar(&featureFlags)
159+
app.Flag("enable-feature", fmt.Sprintf("Experimental features to enable, comma separated. Valid options: %s", strings.Join(featurecontrol.AllowedFlags, ", "))).Default("").StringVar(&featureFlags)
159160

160161
app.Version(version.Print("amtool"))
161162
app.GetFlag("help").Short('h')

cmd/alertmanager/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ func run() int {
176176
tlsConfigFile = kingpin.Flag("cluster.tls-config", "[EXPERIMENTAL] Path to config yaml file that can enable mutual TLS within the gossip protocol.").Default("").String()
177177
allowInsecureAdvertise = kingpin.Flag("cluster.allow-insecure-public-advertise-address-discovery", "[EXPERIMENTAL] Allow alertmanager to discover and listen on a public IP address.").Bool()
178178
label = kingpin.Flag("cluster.label", "The cluster label is an optional string to include on each packet and stream. It uniquely identifies the cluster and prevents cross-communication issues when sending gossip messages.").Default("").String()
179-
featureFlags = kingpin.Flag("enable-feature", fmt.Sprintf("Experimental features to enable. The flag can be repeated to enable multiple features. Valid options: %s", strings.Join(featurecontrol.AllowedFlags, ", "))).Default("").String()
179+
featureFlags = kingpin.Flag("enable-feature", fmt.Sprintf("Comma-separated experimental features to enable. Valid options: %s", strings.Join(featurecontrol.AllowedFlags, ", "))).Default("").String()
180180
)
181181

182182
promslogflag.AddFlags(kingpin.CommandLine, &promslogConfig)

config/config.go

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -968,11 +968,7 @@ type InhibitRule struct {
968968
TargetMatchers Matchers `yaml:"target_matchers,omitempty" json:"target_matchers,omitempty"`
969969
// A set of labels that must be equal between the source and target alert
970970
// for them to be a match.
971-
Equal model.LabelNames `yaml:"-" json:"-"`
972-
// EqualStr allows us to validate the label depending on whether UTF-8 is
973-
// enabled or disabled. It should be removed when Alertmanager is updated
974-
// to use the validation modes in recent versions of prometheus/common.
975-
EqualStr []string `yaml:"equal,omitempty" json:"equal,omitempty"`
971+
Equal []string `yaml:"equal,omitempty" json:"equal,omitempty"`
976972
}
977973

978974
// UnmarshalYAML implements the yaml.Unmarshaler interface for InhibitRule.
@@ -994,12 +990,11 @@ func (r *InhibitRule) UnmarshalYAML(unmarshal func(interface{}) error) error {
994990
}
995991
}
996992

997-
for _, l := range r.EqualStr {
993+
for _, l := range r.Equal {
998994
labelName := model.LabelName(l)
999995
if !compat.IsValidLabelName(labelName) {
1000996
return fmt.Errorf("invalid label name %q in equal list", l)
1001997
}
1002-
r.Equal = append(r.Equal, labelName)
1003998
}
1004999

10051000
return nil

config/config_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1461,7 +1461,7 @@ func TestInhibitRuleEqual(t *testing.T) {
14611461
// The inhibition rule should have the expected equal labels.
14621462
require.Len(t, c.InhibitRules, 1)
14631463
r := c.InhibitRules[0]
1464-
require.Equal(t, model.LabelNames{"qux", "corge"}, r.Equal)
1464+
require.Equal(t, []string{"qux", "corge"}, r.Equal)
14651465

14661466
// Should not be able to load configuration with UTF-8 in equals list.
14671467
_, err = LoadFile("testdata/conf.inhibit-equal-utf8.yml")
@@ -1484,7 +1484,7 @@ func TestInhibitRuleEqual(t *testing.T) {
14841484
// The inhibition rule should have the expected equal labels.
14851485
require.Len(t, c.InhibitRules, 1)
14861486
r = c.InhibitRules[0]
1487-
require.Equal(t, model.LabelNames{"qux", "corge"}, r.Equal)
1487+
require.Equal(t, []string{"qux", "corge"}, r.Equal)
14881488

14891489
// Should also be able to load configuration with UTF-8 in equals list.
14901490
c, err = LoadFile("testdata/conf.inhibit-equal-utf8.yml")
@@ -1493,5 +1493,5 @@ func TestInhibitRuleEqual(t *testing.T) {
14931493
// The inhibition rule should have the expected equal labels.
14941494
require.Len(t, c.InhibitRules, 1)
14951495
r = c.InhibitRules[0]
1496-
require.Equal(t, model.LabelNames{"qux🙂", "corge"}, r.Equal)
1496+
require.Equal(t, []string{"qux🙂", "corge"}, r.Equal)
14971497
}

config/coordinator.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ func NewCoordinator(configFilePath string, r prometheus.Registerer, l *slog.Logg
5555
func (c *Coordinator) registerMetrics(r prometheus.Registerer) {
5656
configHash := prometheus.NewGauge(prometheus.GaugeOpts{
5757
Name: "alertmanager_config_hash",
58-
Help: "Hash of the currently loaded alertmanager configuration.",
58+
Help: "Hash of the currently loaded alertmanager configuration. Note that this is not a cryptographically strong hash.",
5959
})
6060
configSuccess := prometheus.NewGauge(prometheus.GaugeOpts{
6161
Name: "alertmanager_config_last_reload_successful",

config/notifiers.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import (
2424

2525
commoncfg "github.com/prometheus/common/config"
2626
"github.com/prometheus/common/model"
27-
"github.com/prometheus/common/sigv4"
27+
"github.com/prometheus/sigv4"
2828
)
2929

3030
var (

0 commit comments

Comments
 (0)