Skip to content

Commit

Permalink
Update Alertmanager to cab8ecb (#7254) (#7256)
Browse files Browse the repository at this point in the history
  • Loading branch information
grobinson-grafana committed Jan 30, 2024
1 parent f941f47 commit 4109a6a
Show file tree
Hide file tree
Showing 12 changed files with 32 additions and 32 deletions.
2 changes: 1 addition & 1 deletion cmd/mimir/config-descriptor.json
Original file line number Diff line number Diff line change
Expand Up @@ -13623,7 +13623,7 @@
"kind": "field",
"name": "utf8_strict_mode",
"required": false,
"desc": "Enable UTF-8 strict mode. Allows UTF-8 characters in the matchers for routes and inhibition rules, in silences, and in the labels for alerts. It is recommended to check both alertmanager_matchers_disagree and alertmanager_matchers_incompatible metrics before using this mode as otherwise some tenant configurations might fail to load.",
"desc": "Enable UTF-8 strict mode. Allows UTF-8 characters in the matchers for routes and inhibition rules, in silences, and in the labels for alerts. It is recommended to check both alertmanager_matchers_disagree_total and alertmanager_matchers_incompatible_total metrics before using this mode as otherwise some tenant configurations might fail to load.",
"fieldValue": null,
"fieldDefaultValue": false,
"fieldFlag": "alertmanager.utf8-strict-mode-enabled",
Expand Down
2 changes: 1 addition & 1 deletion cmd/mimir/help-all.txt.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ Usage of ./cmd/mimir/mimir:
-alertmanager.storage.retention duration
How long should we store stateful data (notification logs and silences). For notification log entries, refers to how long should we keep entries before they expire and are deleted. For silences, refers to how long should tenants view silences after they expire and are deleted. (default 120h0m0s)
-alertmanager.utf8-strict-mode-enabled
[experimental] Enable UTF-8 strict mode. Allows UTF-8 characters in the matchers for routes and inhibition rules, in silences, and in the labels for alerts. It is recommended to check both alertmanager_matchers_disagree and alertmanager_matchers_incompatible metrics before using this mode as otherwise some tenant configurations might fail to load.
[experimental] Enable UTF-8 strict mode. Allows UTF-8 characters in the matchers for routes and inhibition rules, in silences, and in the labels for alerts. It is recommended to check both alertmanager_matchers_disagree_total and alertmanager_matchers_incompatible_total metrics before using this mode as otherwise some tenant configurations might fail to load.
-alertmanager.web.external-url string
The URL under which Alertmanager is externally reachable (eg. could be different than -http.alertmanager-http-prefix in case Alertmanager is served via a reverse proxy). This setting is used both to configure the internal requests router and to generate links in alert templates. If the external URL has a path portion, it will be used to prefix all HTTP endpoints served by Alertmanager, both the UI and API. (default http://localhost:8080/alertmanager)
-api.skip-label-name-validation-header-enabled
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2254,9 +2254,9 @@ alertmanager_client:
# (experimental) Enable UTF-8 strict mode. Allows UTF-8 characters in the
# matchers for routes and inhibition rules, in silences, and in the labels for
# alerts. It is recommended to check both alertmanager_matchers_disagree and
# alertmanager_matchers_incompatible metrics before using this mode as otherwise
# some tenant configurations might fail to load.
# alerts. It is recommended to check both alertmanager_matchers_disagree_total
# and alertmanager_matchers_incompatible_total metrics before using this mode as
# otherwise some tenant configurations might fail to load.
# CLI flag: -alertmanager.utf8-strict-mode-enabled
[utf8_strict_mode: <boolean> | default = false]
```
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ require (
github.com/opentracing-contrib/go-stdlib v1.0.0
github.com/opentracing/opentracing-go v1.2.1-0.20220228012449-10b1cf09e00b
github.com/pkg/errors v0.9.1
github.com/prometheus/alertmanager v0.26.1-0.20240119104350-f92a08d07386
github.com/prometheus/alertmanager v0.26.1-0.20240130102200-cab8ecbc95c4
github.com/prometheus/client_golang v1.18.0
github.com/prometheus/client_model v0.5.0
github.com/prometheus/common v0.46.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -830,8 +830,8 @@ github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRI
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI=
github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s=
github.com/prometheus/alertmanager v0.26.1-0.20240119104350-f92a08d07386 h1:jcyYvVOHEllcJsH23+TU7MFPUaNHga4TJ43v+Zt4Zts=
github.com/prometheus/alertmanager v0.26.1-0.20240119104350-f92a08d07386/go.mod h1:pT85bjw8Hkt/ZfVpa/b0gLWQc015Yjbi02eCYD0yRl4=
github.com/prometheus/alertmanager v0.26.1-0.20240130102200-cab8ecbc95c4 h1:2QqZsz1XYxCMOC7Siw6bU5E8dAa0Z5DNSyd1w262oHM=
github.com/prometheus/alertmanager v0.26.1-0.20240130102200-cab8ecbc95c4/go.mod h1:pT85bjw8Hkt/ZfVpa/b0gLWQc015Yjbi02eCYD0yRl4=
github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
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=
Expand Down
12 changes: 6 additions & 6 deletions integration/alertmanager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -318,10 +318,10 @@ func TestAlertmanagerMatchersMetrics(t *testing.T) {

// The metrics should all be zero as no configurations contain matchers.
metricNames := []string{
"alertmanager_matchers_parse",
"alertmanager_matchers_disagree",
"alertmanager_matchers_incompatible",
"alertmanager_matchers_invalid",
"alertmanager_matchers_parse_total",
"alertmanager_matchers_disagree_total",
"alertmanager_matchers_incompatible_total",
"alertmanager_matchers_invalid_total",
}
metrics, err := alertmanager.SumMetrics(metricNames, e2e.SkipMissingMetrics)
require.NoError(t, err)
Expand All @@ -334,15 +334,15 @@ func TestAlertmanagerMatchersMetrics(t *testing.T) {
require.NoError(t, c1.SetAlertmanagerConfig(ctx, mimirAlertmanagerUserClassicConfigYaml, nil))
metrics, err = alertmanager.SumMetrics(metricNames, e2e.SkipMissingMetrics)
require.NoError(t, err)
// The sum for alertmanager_matchers_parse should be 4 as there are two matchers for origin=api
// The sum for alertmanager_matchers_parse_total should be 4 as there are two matchers for origin=api
// and another two matchers for origin=config.
require.Equal(t, []float64{4, 0, 0, 0}, metrics)

// Upload a configuration for user2.
require.NoError(t, c2.SetAlertmanagerConfig(ctx, mimirAlertmanagerUserClassicConfigYaml, nil))
metrics, err = alertmanager.SumMetrics(metricNames, e2e.SkipMissingMetrics)
require.NoError(t, err)
// The sum for alertmanager_matchers_parse should be 8 as there are two matchers for origin=api
// The sum for alertmanager_matchers_parse_total should be 8 as there are two matchers for origin=api
// and another two matchers for origin=config, and 4 from the previous sum.
require.Equal(t, []float64{8, 0, 0, 0}, metrics)

Expand Down
2 changes: 1 addition & 1 deletion pkg/alertmanager/alertmanager_config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ inhibit_rules:
}
}

func requireMetric(t *testing.T, expected float64, m *prometheus.GaugeVec) {
func requireMetric(t *testing.T, expected float64, m *prometheus.CounterVec) {
if expected == 0 {
require.Equal(t, 0, testutil.CollectAndCount(m))
} else {
Expand Down
2 changes: 1 addition & 1 deletion pkg/alertmanager/multitenant.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ func (cfg *MultitenantAlertmanagerConfig) RegisterFlags(f *flag.FlagSet, logger

f.DurationVar(&cfg.PeerTimeout, "alertmanager.peer-timeout", defaultPeerTimeout, "Time to wait between peers to send notifications.")

f.BoolVar(&cfg.UTF8StrictMode, "alertmanager.utf8-strict-mode-enabled", false, "Enable UTF-8 strict mode. Allows UTF-8 characters in the matchers for routes and inhibition rules, in silences, and in the labels for alerts. It is recommended to check both alertmanager_matchers_disagree and alertmanager_matchers_incompatible metrics before using this mode as otherwise some tenant configurations might fail to load.")
f.BoolVar(&cfg.UTF8StrictMode, "alertmanager.utf8-strict-mode-enabled", false, "Enable UTF-8 strict mode. Allows UTF-8 characters in the matchers for routes and inhibition rules, in silences, and in the labels for alerts. It is recommended to check both alertmanager_matchers_disagree_total and alertmanager_matchers_incompatible_total metrics before using this mode as otherwise some tenant configurations might fail to load.")
}

// Validate config and returns error on failure
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendor/modules.txt

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 4109a6a

Please sign in to comment.