From 4cdf949b7def7961b4978ef772c57f53ac0de725 Mon Sep 17 00:00:00 2001 From: Julien Pivotto Date: Tue, 4 May 2021 16:10:35 +0200 Subject: [PATCH 1/9] Release 0.22.0-rc.0 Signed-off-by: Julien Pivotto --- CHANGELOG.md | 28 ++++++++++++++++++++++++++++ VERSION | 2 +- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 93dc0aff..f5db610b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,31 @@ +## 0.22.0-rc.0 / 2021-05-04 + +* [CHANGE] Amtool and Alertmanager binaries help now prints to stdout. #2505 +* [CHANGE] Use path relative to the configuration file for certificates and password files. #2502 +* [CHANGE] Display Silence and Alert dates in ISO8601 format. #2363 +* [FEATURE] Add date picker to silence form views. #2262 +* [FEATURE] Add support for negative matchers. #2434 #2460 and many more. +* [FEATURE] Add time-based muting to routing tree. #2393 +* [FEATURE] Support TLS and basic authentication on the web server. #2446 +* [FEATURE] Add OAuth 2.0 client support in HTTP client. #2560 +* [ENHANCEMENT] Add composite durations in the configuration (e.g. 2h20m). #2353 +* [ENHANCEMENT] Add follow_redirect option to disable following redirects. #2551 +* [ENHANCEMENT] Add metric for permanently failed notifications. #2383 +* [ENHANCEMENT] Add support for custom authorization scheme. #2499 +* [ENHANCEMENT] Add support for not following HTTP redirects. #2499 +* [ENHANCEMENT] Add support to set the Slack URL from a file. #2534 +* [ENHANCEMENT] amtool: Add alert status to extended and simple output. #2324 +* [ENHANCEMENT] Do not omit false booleans in the configuration page. #2317 +* [ENHANCEMENT] PagerDuty: Filter out empty images and links. #2379 +* [ENHANCEMENT] WeChat: add markdown support. #2309 +* [BUGFIX] Fix a possible deadlock on shutdown. #2558 +* [BUGFIX] UI: Fix extended printing of regex sign. #2445 +* [BUGFIX] UI: Fix the favicon when using a path prefix. #2392 +* [BUGFIX] Make filter labels consistent with Prometheus. #2403 +* [BUGFIX] alertmanager_config_last_reload_successful takes templating failures into account. #2373 +* [BUGFIX] amtool: avoid nil dereference in silence update. #2427 +* [BUGFIX] VictorOps: Catch routing_key templating errors. #2467 + ## 0.21.0 / 2020-06-16 This release removes the HipChat integration as it is discontinued by Atlassian on June 30th 2020. diff --git a/VERSION b/VERSION index 88541566..8f525c2c 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.21.0 +0.22.0-rc.0 From edc148b068d65a312037c1bf60d96093362a188d Mon Sep 17 00:00:00 2001 From: Julien Pivotto Date: Wed, 5 May 2021 11:02:20 +0200 Subject: [PATCH 2/9] Add #2276 to release notes Signed-off-by: Julien Pivotto --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f5db610b..42015180 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ * [ENHANCEMENT] Add support to set the Slack URL from a file. #2534 * [ENHANCEMENT] amtool: Add alert status to extended and simple output. #2324 * [ENHANCEMENT] Do not omit false booleans in the configuration page. #2317 +* [ENHANCEMENT] OpsGenie: Propagate labels to Opsgenie details. #2276 * [ENHANCEMENT] PagerDuty: Filter out empty images and links. #2379 * [ENHANCEMENT] WeChat: add markdown support. #2309 * [BUGFIX] Fix a possible deadlock on shutdown. #2558 From 0ed31c3311c66eda25677b6f81aa123809b4109a Mon Sep 17 00:00:00 2001 From: beorn7 Date: Thu, 6 May 2021 19:17:25 +0200 Subject: [PATCH 3/9] Update matcher examples While the documentation for the matchers themselves was updated, we missed the examples. I propose to merge this into the release-0.22 branch so that it gets included in the ongoing release. Signed-off-by: beorn7 --- doc/examples/simple.yml | 36 +++++++++++++++++------------------- docs/configuration.md | 16 ++++++++-------- 2 files changed, 25 insertions(+), 27 deletions(-) diff --git a/doc/examples/simple.yml b/doc/examples/simple.yml index 02063546..1cd24b9c 100644 --- a/doc/examples/simple.yml +++ b/doc/examples/simple.yml @@ -47,39 +47,39 @@ route: routes: # This routes performs a regular expression match on alert labels to # catch alerts that are related to a list of services. - - match_re: - service: ^(foo1|foo2|baz)$ + - matchers: + - service=~"foo1|foo2|baz" receiver: team-X-mails # The service has a sub-route for critical alerts, any alerts # that do not match, i.e. severity != critical, fall-back to the # parent node and are sent to 'team-X-mails' routes: - - match: - severity: critical + - matchers: + - severity="critical" receiver: team-X-pager - - match: - service: files + - matchers: + - service="files" receiver: team-Y-mails routes: - - match: - severity: critical + - matchers: + - severity="critical" receiver: team-Y-pager # This route handles all alerts coming from a database service. If there's # no team to handle it, it defaults to the DB team. - - match: - service: database + - matchers: + - service="database" receiver: team-DB-pager # Also group alerts by affected database. group_by: [alertname, cluster, database] routes: - - match: - owner: team-X + - matchers: + - owner="team-X" receiver: team-X-pager continue: true - - match: - owner: team-Y + - matchers: + - owner="team-Y" receiver: team-Y-pager @@ -88,16 +88,14 @@ route: # We use this to mute any warning-level notifications if the same alert is # already critical. inhibit_rules: -- source_match: - severity: 'critical' - target_match: - severity: 'warning' +- source_matchers: [ severity="critical" ] + target_matchers: [ severity="warning" ] # Apply inhibition if the alertname is the same. # CAUTION: # If all label names listed in `equal` are missing # from both the source and target alerts, # the inhibition rule will apply! - equal: ['alertname', 'cluster', 'service'] + equal: [ alertname, cluster, service ] receivers: diff --git a/docs/configuration.md b/docs/configuration.md index a2902285..07133ca0 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -211,15 +211,15 @@ route: # are dispatched to the database pager. - receiver: 'database-pager' group_wait: 10s - match_re: - service: mysql|cassandra + matchers: + - service=~"mysql|cassandra" # All alerts with the team=frontend label match this sub-route. # They are grouped by product and environment rather than cluster # and alertname. - receiver: 'frontend-pager' group_by: [product, environment] - match: - team: frontend + matchers: + - team="frontend" ``` ## `` @@ -326,7 +326,7 @@ source_match_re: # A list of matchers for which one or more alerts have # to exist for the inhibition to take effect. source_matchers: - [ - ... ] + [ - ... ] # Labels that must have an equal value in the source and target # alert for the inhibition to take effect. @@ -705,12 +705,12 @@ The 3rd token may be the empty string. Within the 3rd token, OpenMetrics escapin In the configuration, multiple matchers are combined in a YAML list. However, it is also possible to combine multiple matchers within a single YAML string, again using syntax inspired by PromQL. In such a string, a leading `{` and/or a trailing `}` is optional and will be trimmed before further parsing. Individual matchers are separated by commas outside of quoted parts of the string. Those commas may be surrounded by whitespace. Parts of the string inside unescaped double quotes `"…"` are considered quoted (and commas don't act as separators there). If double quotes are escaped with a single backslash `\`, they are ignored for the purpose of identifying quoted parts of the input string. If the input string, after trimming the optional trailing `}`, ends with a comma, followed by optional whitespace, this comma and whitespace will be trimmed. -Here are some examples of valid string matchers : +Here are some examples of valid string matchers: 1. Shown below are two equality matchers combined in a long form YAML list. ```yaml - matchers : + matchers: - foo = bar - dings !=bums ``` @@ -912,4 +912,4 @@ API](http://admin.wechat.com/wiki/index.php?title=Customer_Service_Messages). [ to_user: | default = '{{ template "wechat.default.to_user" . }}' ] [ to_party: | default = '{{ template "wechat.default.to_party" . }}' ] [ to_tag: | default = '{{ template "wechat.default.to_tag" . }}' ] -``` \ No newline at end of file +``` From 64e108c3d4a98a70c8498f57afb3dc86396b380c Mon Sep 17 00:00:00 2001 From: Julien Pivotto Date: Fri, 7 May 2021 00:26:41 +0200 Subject: [PATCH 4/9] Fix panic when HA is disabled Fix #2549 Signed-off-by: Julien Pivotto --- cmd/alertmanager/main.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/cmd/alertmanager/main.go b/cmd/alertmanager/main.go index c963b2b9..9327d7a2 100644 --- a/cmd/alertmanager/main.go +++ b/cmd/alertmanager/main.go @@ -426,6 +426,15 @@ func run() int { inhibitor = inhibit.NewInhibitor(alerts, conf.InhibitRules, marker, logger) silencer := silence.NewSilencer(silences, marker, logger) + + // An interface value that holds a nil concrete value is non-nil. + // Therefore we explicly pass an empty interface, to detect if the + // cluster is not enabled in notify. + var pipelinePeer notify.Peer + if peer != nil { + pipelinePeer = peer + } + pipeline := pipelineBuilder.New( receivers, waitFunc, @@ -433,7 +442,7 @@ func run() int { silencer, muteTimes, notificationLog, - peer, + pipelinePeer, ) configuredReceivers.Set(float64(len(activeReceivers))) configuredIntegrations.Set(float64(integrationsNum)) From c9667d8b08ca3db797965e994c060217de36311b Mon Sep 17 00:00:00 2001 From: Julien Pivotto Date: Sun, 9 May 2021 21:48:38 +0200 Subject: [PATCH 5/9] Release 0.22.0-rc.1 Signed-off-by: Julien Pivotto --- CHANGELOG.md | 2 +- VERSION | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 42015180..16b63f91 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -## 0.22.0-rc.0 / 2021-05-04 +## 0.22.0-rc.1 / 2021-05-10 * [CHANGE] Amtool and Alertmanager binaries help now prints to stdout. #2505 * [CHANGE] Use path relative to the configuration file for certificates and password files. #2502 diff --git a/VERSION b/VERSION index 8f525c2c..c1eef648 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.22.0-rc.0 +0.22.0-rc.1 From a33bc8c2d416baeb34ef53cfcaa34260cef1602e Mon Sep 17 00:00:00 2001 From: Dominik Zalewski Date: Mon, 10 May 2021 21:48:50 +0100 Subject: [PATCH 6/9] fixed small typo Signed-off-by: Dominik Zalewski --- docs/https.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/https.md b/docs/https.md index e4749010..7493652d 100644 --- a/docs/https.md +++ b/docs/https.md @@ -8,7 +8,7 @@ sort_rank: 11 Alertmanager supports basic authentication and TLS. This is **experimental** and might change in the future. -Currentlu TLS is only supported for the HTTP traffic. Gossip traffic does not +Currently TLS is only supported for the HTTP traffic. Gossip traffic does not support encryption yet. To specify which web configuration file to load, use the `--web.config.file` flag. From 4d2aea63c19d6ae8d615495604ee73079f894ac3 Mon Sep 17 00:00:00 2001 From: Julien Pivotto Date: Fri, 14 May 2021 18:11:55 +0200 Subject: [PATCH 7/9] API: Only pass cluster peer if empty Fixes #2580 Signed-off-by: Julien Pivotto --- cmd/alertmanager/main.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/cmd/alertmanager/main.go b/cmd/alertmanager/main.go index 9327d7a2..c6ff481e 100644 --- a/cmd/alertmanager/main.go +++ b/cmd/alertmanager/main.go @@ -335,11 +335,19 @@ func run() int { return disp.Groups(routeFilter, alertFilter) } + // An interface value that holds a nil concrete value is non-nil. + // Therefore we explicly pass an empty interface, to detect if the + // cluster is not enabled in notify. + var clusterPeer cluster.ClusterPeer + if peer != nil { + clusterPeer = peer + } + api, err := api.New(api.Options{ Alerts: alerts, Silences: silences, StatusFunc: marker.Status, - Peer: peer, + Peer: clusterPeer, Timeout: *httpTimeout, Concurrency: *getConcurrency, Logger: log.With(logger, "component", "api"), From a51874cb868b042c35fff3616651563ffe830de6 Mon Sep 17 00:00:00 2001 From: Julien Pivotto Date: Mon, 17 May 2021 23:50:05 +0200 Subject: [PATCH 8/9] Relase 0.22.0-rc.2 Signed-off-by: Julien Pivotto --- CHANGELOG.md | 2 +- VERSION | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 16b63f91..20a1c763 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -## 0.22.0-rc.1 / 2021-05-10 +## 0.22.0-rc.2 / 2021-05-17 * [CHANGE] Amtool and Alertmanager binaries help now prints to stdout. #2505 * [CHANGE] Use path relative to the configuration file for certificates and password files. #2502 diff --git a/VERSION b/VERSION index c1eef648..9141d34c 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.22.0-rc.1 +0.22.0-rc.2 From 0394ddcac318fa89e9d0c66cbf75d4acfcb71272 Mon Sep 17 00:00:00 2001 From: Julien Pivotto Date: Fri, 21 May 2021 12:12:49 +0200 Subject: [PATCH 9/9] Release alertmanager 0.22 Signed-off-by: Julien Pivotto --- CHANGELOG.md | 2 +- VERSION | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 20a1c763..4d979022 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -## 0.22.0-rc.2 / 2021-05-17 +## 0.22.0 / 2021-05-21 * [CHANGE] Amtool and Alertmanager binaries help now prints to stdout. #2505 * [CHANGE] Use path relative to the configuration file for certificates and password files. #2502 diff --git a/VERSION b/VERSION index 9141d34c..21574090 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.22.0-rc.2 +0.22.0