From c00f4d27b877799389e0327c64e25b021cfd6210 Mon Sep 17 00:00:00 2001 From: Steve Simpson Date: Tue, 25 May 2021 15:10:28 +0200 Subject: [PATCH] Add changelog for alertmanager sharding and add experimental warning log. Signed-off-by: Steve Simpson Review comments. Signed-off-by: Steve Simpson Fix doing numbers bad. Signed-off-by: Steve Simpson --- CHANGELOG.md | 6 ++++++ pkg/alertmanager/multitenant.go | 3 +++ 2 files changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0ea3f00722b..4f3517a57bc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,12 @@ * [FEATURE] Alertmanager: Added `-alertmanager.max-config-size-bytes` limit to control size of configuration files that Cortex users can upload to Alertmanager via API. This limit is configurable per-tenant. #4201 * [FEATURE] Alertmanager: Added `-alertmanager.max-templates-count` and `-alertmanager.max-template-size-bytes` options to control number and size of templates uploaded to Alertmanager via API. These limits are configurable per-tenant. #4223 * [FEATURE] Added flag `-debug.block-profile-rate` to enable goroutine blocking events profiling. #4217 +* [FEATURE] Alertmanager: The experimental sharding feature is now considered complete. Detailed information about the configuration options can be found [here for alertmanager](https://cortexmetrics.io/docs/configuration/configuration-file/#alertmanager_config) and [here for the alertmanager storage](https://cortexmetrics.io/docs/configuration/configuration-file/#alertmanager_storage_config). To use the feature: #3925 #4020 #4021 #4031 #4084 #4110 #4126 #4127 #4141 #4146 #4161 #4162 #4222 + * Ensure that a remote storage backend is configured for Alertmanager to store state using `-alertmanager-storage.backend`, and flags related to the backend. Note that the `local` and `configdb` storage backends are not supported. + * Ensure that a ring store is configured using `-alertmanager.sharding-ring.store`, and set the flags relevant to the chosen store type. + * Enable the feature using `-alertmanager.sharding-enabled`. + * Note the prior addition of a new configuration option `-alertmanager.persist-interval`. This sets the interval between persisting the current alertmanager state (notification log and silences) to object storage. See the [configuration file reference](https://cortexmetrics.io/docs/configuration/configuration-file/#alertmanager_config) for more information. +* [ENHANCEMENT] Alertmanager: Cleanup persisted state objects from remote storage when a tenant configuration is deleted. #4167 * [ENHANCEMENT] Storage: Added the ability to disable Open Census within GCS client (e.g `-gcs.enable-opencensus=false`). #4219 * [ENHANCEMENT] Alertmanager: introduced new metrics to monitor operation when using `-alertmanager.sharding-enabled`: #4149 * `cortex_alertmanager_state_fetch_replica_state_total` diff --git a/pkg/alertmanager/multitenant.go b/pkg/alertmanager/multitenant.go index c87c16b72b4..b34f8a812c0 100644 --- a/pkg/alertmanager/multitenant.go +++ b/pkg/alertmanager/multitenant.go @@ -38,6 +38,7 @@ import ( "github.com/cortexproject/cortex/pkg/util" "github.com/cortexproject/cortex/pkg/util/concurrency" "github.com/cortexproject/cortex/pkg/util/flagext" + util_log "github.com/cortexproject/cortex/pkg/util/log" "github.com/cortexproject/cortex/pkg/util/services" ) @@ -364,6 +365,8 @@ func NewMultitenantAlertmanager(cfg *MultitenantAlertmanagerConfig, store alerts var ringStore kv.Client if cfg.ShardingEnabled { + util_log.WarnExperimentalUse("Alertmanager sharding") + ringStore, err = kv.NewClient( cfg.ShardingRing.KVStore, ring.GetCodec(),