From 77ab544b32424ec4ad9edf5dd7400f9d8bde2f62 Mon Sep 17 00:00:00 2001 From: Matthieu MOREL Date: Thu, 5 Dec 2024 08:25:56 +0100 Subject: [PATCH 1/4] chore(deps): bump `github.com/prometheus/common` from 0.60.0 to 0.61.0 and use `version.ComponentUserAgent` Signed-off-by: Matthieu MOREL --- config/notifiers.go | 2 +- go.mod | 2 +- go.sum | 8 ++------ notify/sns/sns_test.go | 2 +- notify/util.go | 2 +- 5 files changed, 6 insertions(+), 10 deletions(-) diff --git a/config/notifiers.go b/config/notifiers.go index 74c74a92a0..87f806aa27 100644 --- a/config/notifiers.go +++ b/config/notifiers.go @@ -24,7 +24,7 @@ import ( commoncfg "github.com/prometheus/common/config" "github.com/prometheus/common/model" - "github.com/prometheus/common/sigv4" + "github.com/prometheus/sigv4" ) var ( diff --git a/go.mod b/go.mod index eec324c992..886f16f31d 100644 --- a/go.mod +++ b/go.mod @@ -32,8 +32,8 @@ require ( github.com/prometheus/client_golang v1.20.5 github.com/prometheus/common v0.61.0 github.com/prometheus/common/assets v0.2.0 - github.com/prometheus/common/sigv4 v0.1.0 github.com/prometheus/exporter-toolkit v0.13.2 + github.com/prometheus/sigv4 v0.1.0 github.com/rs/cors v1.11.1 github.com/shurcooL/httpfs v0.0.0-20230704072500-f1e31cf0ba5c github.com/shurcooL/vfsgen v0.0.0-20230704071429-0000e147ea92 diff --git a/go.sum b/go.sum index c168c8f668..8b90e15442 100644 --- a/go.sum +++ b/go.sum @@ -78,7 +78,6 @@ github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 h1:DklsrG3dyBCFEj5IhUbnKptjxatkF07cF2ak3yi77so= github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= -github.com/aws/aws-sdk-go v1.38.35/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= github.com/aws/aws-sdk-go v1.55.5 h1:KKUZBfBoyqy5d3swXyiC7Q76ic40rYcbqH7qjh59kzU= github.com/aws/aws-sdk-go v1.55.5/go.mod h1:eRwEWoyTWFMVYVQzKMNHWP5/RV4xIUGMQfXQHfHkpNU= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= @@ -429,7 +428,6 @@ github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXP github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= github.com/prometheus/client_golang v1.11.1/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= github.com/prometheus/client_golang v1.20.5 h1:cxppBPuYhUnsO6yo/aoRol4L7q7UFfdm+bR9r+8l63Y= github.com/prometheus/client_golang v1.20.5/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= @@ -443,13 +441,10 @@ github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y8 github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= -github.com/prometheus/common v0.29.0/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= github.com/prometheus/common v0.61.0 h1:3gv/GThfX0cV2lpO7gkTUwZru38mxevy90Bj8YFSRQQ= github.com/prometheus/common v0.61.0/go.mod h1:zr29OCN/2BsJRaFwG8QOBr41D6kkchKbpeNH7pAjb/s= github.com/prometheus/common/assets v0.2.0 h1:0P5OrzoHrYBOSM1OigWL3mY8ZvV2N4zIE/5AahrSrfM= github.com/prometheus/common/assets v0.2.0/go.mod h1:D17UVUE12bHbim7HzwUvtqm6gwBEaDQ0F+hIGbFbccI= -github.com/prometheus/common/sigv4 v0.1.0 h1:qoVebwtwwEhS85Czm2dSROY5fTo2PAPEVdDeppTwGX4= -github.com/prometheus/common/sigv4 v0.1.0/go.mod h1:2Jkxxk9yYvCkE5G1sQT7GuEXm57JrvHu9k5YwTjsNtI= github.com/prometheus/exporter-toolkit v0.13.2 h1:Z02fYtbqTMy2i/f+xZ+UK5jy/bl1Ex3ndzh06T/Q9DQ= github.com/prometheus/exporter-toolkit v0.13.2/go.mod h1:tCqnfx21q6qN1KA4U3Bfb8uWzXfijIrJz3/kTIqMV7g= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= @@ -459,6 +454,8 @@ github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4O github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= +github.com/prometheus/sigv4 v0.1.0 h1:FgxH+m1qf9dGQ4w8Dd6VkthmpFQfGTzUeavMoQeG1LA= +github.com/prometheus/sigv4 v0.1.0/go.mod h1:doosPW9dOitMzYe2I2BN0jZqUuBrGPbXrNsTScN18iU= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= @@ -632,7 +629,6 @@ golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLd golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210410081132-afb366fc7cd1/go.mod h1:9tjilg8BloeKEkVJvy7fQ90B1CfIiPueXVOjqfkSzI8= golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= diff --git a/notify/sns/sns_test.go b/notify/sns/sns_test.go index 7e00616e92..bb64b1132e 100644 --- a/notify/sns/sns_test.go +++ b/notify/sns/sns_test.go @@ -21,7 +21,7 @@ import ( commoncfg "github.com/prometheus/common/config" "github.com/prometheus/common/promslog" - "github.com/prometheus/common/sigv4" + "github.com/prometheus/sigv4" "github.com/stretchr/testify/require" "github.com/prometheus/alertmanager/config" diff --git a/notify/util.go b/notify/util.go index 14e3050bdb..9d73fb44d4 100644 --- a/notify/util.go +++ b/notify/util.go @@ -34,7 +34,7 @@ import ( const truncationMarker = "…" // UserAgentHeader is the default User-Agent for notification requests. -var UserAgentHeader = fmt.Sprintf("Alertmanager/%s", version.Version) +var UserAgentHeader = version.ComponentUserAgent("Alertmanager") // RedactURL removes the URL part from an error of *url.Error type. func RedactURL(err error) error { From f63fc7a11170d11134bdf954e6aa5ba33ac8778a Mon Sep 17 00:00:00 2001 From: Oleg Nikachev Date: Thu, 16 Jan 2025 16:16:35 +0400 Subject: [PATCH 2/4] Fixed formatting error Fixed a formatting error that made the section unavailable from the menu in the web documentation Signed-off-by: Oleg Nikachev --- docs/configuration.md | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/docs/configuration.md b/docs/configuration.md index f2a4f6b197..d06a8d6f4a 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -309,6 +309,7 @@ name: time_intervals: [ - ... ] ``` + #### `` A `time_interval_spec` contains the actual definition for an interval of time. The syntax @@ -339,9 +340,11 @@ make it easy to represent times that start/end on hour boundaries. For example, `start_time: '17:00'` and `end_time: '24:00'` will begin at 17:00 and finish immediately before 24:00. They are specified like so: - times: - - start_time: HH:MM - end_time: HH:MM +```yaml +times: +- start_time: HH:MM + end_time: HH:MM +``` `weekday_range`: A list of days of the week, where the week begins on Sunday and ends on Saturday. Days should be specified by name (e.g. 'Sunday'). For convenience, ranges are also accepted @@ -367,10 +370,12 @@ example, `'Australia/Sydney'`. The location provides the time zone for the time interval. For example, a time interval with a location of `'Australia/Sydney'` that contained something like: - times: - - start_time: 09:00 - end_time: 17:00 - weekdays: ['monday:friday'] +```yaml +times: +- start_time: 09:00 + end_time: 17:00 +weekdays: ['monday:friday'] +``` would include any time that fell between the hours of 9:00AM and 5:00PM, between Monday and Friday, using the local time in Sydney, Australia. @@ -437,7 +442,6 @@ source_matchers: # Labels that must have an equal value in the source and target # alert for the inhibition to take effect. [ equal: '[' , ... ']' ] - ``` ## Label matchers @@ -482,7 +486,7 @@ Any occurrences of disagreement should be looked at on a case by case basis as d In UTF-8 strict mode, Alertmanager disables support for classic matchers: -``` +```bash alertmanager --config.file=config.yml --enable-feature="utf8-strict-mode" ``` @@ -498,7 +502,7 @@ UTF-8 strict mode will be the default mode of Alertmanager at the end of the tra Classic mode is equivalent to Alertmanager versions 0.26.0 and older: -``` +```bash alertmanager --config.file=config.yml --enable-feature="classic-mode" ``` @@ -1347,6 +1351,7 @@ The fields are documented in the [Rocketchat API documentation](https://develope ``` #### `` + The fields are documented in the [Rocketchat API api models](https://github.com/RocketChat/Rocket.Chat.Go.SDK/blob/master/models/message.go). ```yaml @@ -1354,6 +1359,7 @@ The fields are documented in the [Rocketchat API api models](https://github.com/ [ text: ] [ url: ] [ msg: ] +``` ### `` @@ -1600,7 +1606,6 @@ url_file: # no timeout should be applied. # NOTE: This will have no effect if set higher than the group_interval. [ timeout: | default = 0s ] - ``` The Alertmanager From ce016af70f0eb893cab8d136fbbeb76a3d41ba1c Mon Sep 17 00:00:00 2001 From: SuperQ Date: Thu, 16 Jan 2025 15:07:22 +0100 Subject: [PATCH 3/4] Bump UI docker image Update to current Node/Debian Docker image. * Bump elm-format to current release. Signed-off-by: SuperQ --- ui/Dockerfile | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/ui/Dockerfile b/ui/Dockerfile index 8cdf0dd230..2e0bd539cb 100644 --- a/ui/Dockerfile +++ b/ui/Dockerfile @@ -1,13 +1,11 @@ -# elm-format only works with buster variants of the NodeJS container image. -# See https://github.com/avh4/elm-format/issues/709 for more details. -FROM node:14-buster +FROM node:22-bookworm ENV NPM_CONFIG_PREFIX=/home/node/.npm-global ENV PATH=$PATH:/home/node/.npm-global/bin RUN mkdir -p $NPM_CONFIG_PREFIX; yarn global add \ elm@0.19.1 \ - elm-format@0.8.5 \ + elm-format@0.8.7 \ elm-test@0.19.1-revision6 \ uglify-js@3.13.4 \ elm-review@2.5.0 From fa65edb1f8962848f80c2c446334854ba3ac83d7 Mon Sep 17 00:00:00 2001 From: Alexander Weaver Date: Fri, 17 Jan 2025 04:29:30 -0600 Subject: [PATCH 4/4] Document (#4210) Signed-off-by: Alex Weaver --- config/coordinator.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/coordinator.go b/config/coordinator.go index 48728c4e76..68d1f0307a 100644 --- a/config/coordinator.go +++ b/config/coordinator.go @@ -55,7 +55,7 @@ func NewCoordinator(configFilePath string, r prometheus.Registerer, l *slog.Logg func (c *Coordinator) registerMetrics(r prometheus.Registerer) { configHash := prometheus.NewGauge(prometheus.GaugeOpts{ Name: "alertmanager_config_hash", - Help: "Hash of the currently loaded alertmanager configuration.", + Help: "Hash of the currently loaded alertmanager configuration. Note that this is not a cryptographically strong hash.", }) configSuccess := prometheus.NewGauge(prometheus.GaugeOpts{ Name: "alertmanager_config_last_reload_successful",