diff --git a/CHANGELOG.md b/CHANGELOG.md index f34a231c55..ca6e4b3033 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ * [FEATURE] Ruler: Add `ruler.concurrent-evals-enabled` flag to enable concurrent evaluation within a single rule group for independent rules. Maximum concurrency can be configured via `ruler.max-concurrent-evals`. #5766 * [FEATURE] Distributor Queryable: Experimental: Add config `zone_results_quorum_metadata`. When querying ingesters using metadata APIs such as label names and values, only results from quorum number of zones will be included and merged. #5779 * [FEATURE] Storage Cache Clients: Add config `set_async_circuit_breaker_config` to utilize the circuit breaker pattern for dynamically thresholding asynchronous set operations. Implemented in both memcached and redis cache clients. #5789 +* [FEATURE] Alert Manager: Add support for the new AM `alertmanager.enable-feature` experimental flag. #5841 * [ENHANCEMENT] Store Gateway: Added `-store-gateway.enabled-tenants` and `-store-gateway.disabled-tenants` to explicitly enable or disable store-gateway for specific tenants. #5638 * [ENHANCEMENT] Compactor: Add new compactor metric `cortex_compactor_start_duration_seconds`. #5683 * [ENHANCEMENT] Upgraded Docker base images to `alpine:3.18`. #5684 diff --git a/docs/configuration/config-file-reference.md b/docs/configuration/config-file-reference.md index 60fbc8707c..8e4726a76e 100644 --- a/docs/configuration/config-file-reference.md +++ b/docs/configuration/config-file-reference.md @@ -293,11 +293,10 @@ The `alertmanager_config` configures the Cortex alertmanager. # CLI flag: -alertmanager.max-recv-msg-size [max_recv_msg_size: | default = 16777216] -# Prometheus AlertManager experimental features to enable. The flag can be -# repeated to enable multiple features. Valid options: receiver-name-in-metrics, -# classic-mode, utf8-strict-mode +# Comma separated list of prometheus alertManager features to enable. Valid +# options: receiver-name-in-metrics, classic-mode, utf8-strict-mode # CLI flag: -alertmanager.enable-feature -[feature_flags: | default = ""] +[enable_feature: | default = ""] # Shard tenants across multiple alertmanager instances. # CLI flag: -alertmanager.sharding-enabled diff --git a/pkg/alertmanager/multitenant.go b/pkg/alertmanager/multitenant.go index 15714ec046..2e1fd0d29c 100644 --- a/pkg/alertmanager/multitenant.go +++ b/pkg/alertmanager/multitenant.go @@ -65,12 +65,12 @@ var ( // MultitenantAlertmanagerConfig is the configuration for a multitenant Alertmanager. type MultitenantAlertmanagerConfig struct { - DataDir string `yaml:"data_dir"` - Retention time.Duration `yaml:"retention"` - ExternalURL flagext.URLValue `yaml:"external_url"` - PollInterval time.Duration `yaml:"poll_interval"` - MaxRecvMsgSize int64 `yaml:"max_recv_msg_size"` - FeatureFlags string `yaml:"feature_flags"` + DataDir string `yaml:"data_dir"` + Retention time.Duration `yaml:"retention"` + ExternalURL flagext.URLValue `yaml:"external_url"` + PollInterval time.Duration `yaml:"poll_interval"` + MaxRecvMsgSize int64 `yaml:"max_recv_msg_size"` + EnableFeature flagext.StringSliceCSV `yaml:"enable_feature"` // Enable sharding for the Alertmanager ShardingEnabled bool `yaml:"sharding_enabled"` @@ -127,7 +127,7 @@ func (cfg *MultitenantAlertmanagerConfig) RegisterFlags(f *flag.FlagSet) { f.BoolVar(&cfg.ShardingEnabled, "alertmanager.sharding-enabled", false, "Shard tenants across multiple alertmanager instances.") f.Var(&cfg.EnabledTenants, "alertmanager.enabled-tenants", "Comma separated list of tenants whose alerts this alertmanager can process. If specified, only these tenants will be handled by alertmanager, otherwise this alertmanager can process alerts from all tenants.") f.Var(&cfg.DisabledTenants, "alertmanager.disabled-tenants", "Comma separated list of tenants whose alerts this alertmanager cannot process. If specified, a alertmanager that would normally pick the specified tenant(s) for processing will ignore them instead.") - f.StringVar(&cfg.FeatureFlags, "alertmanager.enable-feature", "", fmt.Sprintf("Prometheus AlertManager experimental features to enable. The flag can be repeated to enable multiple features. Valid options: %s", strings.Join(featurecontrol.AllowedFlags, ", "))) + f.Var(&cfg.EnableFeature, "alertmanager.enable-feature", fmt.Sprintf("Comma separated list of prometheus alertManager features to enable. Valid options: %s", strings.Join(featurecontrol.AllowedFlags, ", "))) cfg.AlertmanagerClient.RegisterFlagsWithPrefix("alertmanager.alertmanager-client", f) cfg.Persister.RegisterFlagsWithPrefix("alertmanager", f) @@ -981,7 +981,7 @@ func (am *MultitenantAlertmanager) newAlertmanager(userID string, amConfig *amco Limits: am.limits, APIConcurrency: am.cfg.APIConcurrency, GCInterval: am.cfg.GCInterval, - FeatureFlags: am.cfg.FeatureFlags, + FeatureFlags: am.cfg.EnableFeature.String(), }, reg) if err != nil { return nil, fmt.Errorf("unable to start Alertmanager for user %v: %v", userID, err)