Skip to content

Commit 4618a92

Browse files
committed
Simplify option name, add alertmanager limits to list of experimental features.
Signed-off-by: Peter Štibraný <[email protected]>
1 parent 58dd26a commit 4618a92

File tree

7 files changed

+19
-14
lines changed

7 files changed

+19
-14
lines changed

CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
* `memberlist_client_kv_store_value_tombstones`
3939
* `memberlist_client_kv_store_value_tombstones_removed_total`
4040
* `memberlist_client_messages_to_broadcast_dropped_total`
41-
* [ENHANCEMENT] Alertmanager: Added `-alertmanager.max-number-of-dispatcher-aggregation-groups` option to control max number of active dispatcher groups in Alertmanager (per tenant, also overrideable). When the limit is reached, Dispatcher produces log message and increases `alertmanager_dispatcher_aggregation_group_limit_reached_total` metric. #4254
41+
* [ENHANCEMENT] Alertmanager: Added `-alertmanager.max-dispatcher-aggregation-groups` option to control max number of active dispatcher groups in Alertmanager (per tenant, also overrideable). When the limit is reached, Dispatcher produces log message and increases `alertmanager_dispatcher_aggregation_group_limit_reached_total` metric. #4254
4242
* [BUGFIX] Purger: fix `Invalid null value in condition for column range` caused by `nil` value in range for WriteBatch query. #4128
4343
* [BUGFIX] Ingester: fixed infrequent panic caused by a race condition between TSDB mmap-ed head chunks truncation and queries. #4176
4444
* [BUGFIX] Alertmanager: fix Alertmanager status page if clustering via gossip is disabled or sharding is enabled. #4184

docs/configuration/config-file-reference.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -4178,8 +4178,8 @@ The `limits_config` configures default and per-tenant limits imposed by Cortex s
41784178
# limit is reached, dispatcher will not dispatch alerts that belong to
41794179
# additional aggregation groups, but existing groups will keep working properly.
41804180
# 0 = no limit.
4181-
# CLI flag: -alertmanager.max-number-of-dispatcher-aggregation-groups
4182-
[alertmanager_max_number_of_dispatcher_aggregation_groups: <int> | default = 0]
4181+
# CLI flag: -alertmanager.max-dispatcher-aggregation-groups
4182+
[alertmanager_max_dispatcher_aggregation_groups: <int> | default = 0]
41834183
```
41844184

41854185
### `redis_config`

docs/configuration/v1-guarantees.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,13 @@ Currently experimental features are:
7171
- `-ingester_stream_chunks_when_using_blocks` (boolean) field in runtime config file
7272
- Instance limits in ingester and distributor
7373
- Exemplar storage, currently in-memory only within the Ingester based on Prometheus exemplar storage (`-blocks-storage.tsdb.max-exemplars`)
74-
- Alertmanager: notification rate limits. (`-alertmanager.notification-rate-limit` and `-alertmanager.notification-rate-limit-per-integration`)
7574
- Querier limits:
7675
- `-querier.max-fetched-chunks-per-query`
7776
- `-querier.max-fetched-chunk-bytes-per-query`
7877
- `-querier.max-fetched-series-per-query`
78+
- Alertmanager limits
79+
- notification rate (`-alertmanager.notification-rate-limit` and `-alertmanager.notification-rate-limit-per-integration`)
80+
- dispatcher groups (`-alertmanager.max-dispatcher-aggregation-groups`)
81+
- user config size (`-alertmanager.max-config-size-bytes`)
82+
- templates count in user config (`-alertmanager.max-templates-count`)
83+
- max template size (`-alertmanager.max-template-size-bytes`)

pkg/alertmanager/alertmanager.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -582,5 +582,5 @@ type dispatcherLimits struct {
582582
}
583583

584584
func (g *dispatcherLimits) MaxNumberOfAggregationGroups() int {
585-
return g.limits.AlertmanagerMaxNumberOfDispatcherAggregationGroups(g.tenant)
585+
return g.limits.AlertmanagerMaxDispatcherAggregationGroups(g.tenant)
586586
}

pkg/alertmanager/multitenant.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ type Limits interface {
222222

223223
// AlertmanagerMaxNumberOfDispatcherAggregationGroups returns maximum number of aggregation groups in Alertmanager's dispatcher that a tenant can have.
224224
// Each aggregation group consumes single goroutine. 0 = unlimited.
225-
AlertmanagerMaxNumberOfDispatcherAggregationGroups(t string) int
225+
AlertmanagerMaxDispatcherAggregationGroups(t string) int
226226
}
227227

228228
// A MultitenantAlertmanager manages Alertmanager instances for multiple

pkg/alertmanager/multitenant_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -2055,6 +2055,6 @@ func (m *mockAlertManagerLimits) NotificationBurstSize(_ string, integration str
20552055
return m.emailNotificationBurst
20562056
}
20572057

2058-
func (m *mockAlertManagerLimits) AlertmanagerMaxNumberOfDispatcherAggregationGroups(_ string) int {
2058+
func (m *mockAlertManagerLimits) AlertmanagerMaxDispatcherAggregationGroups(_ string) int {
20592059
return m.maxDispatcherAggregationGroups
20602060
}

pkg/util/validation/limits.go

+7-7
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,10 @@ type Limits struct {
106106
NotificationRateLimit float64 `yaml:"alertmanager_notification_rate_limit" json:"alertmanager_notification_rate_limit"`
107107
NotificationRateLimitPerIntegration NotificationRateLimitMap `yaml:"alertmanager_notification_rate_limit_per_integration" json:"alertmanager_notification_rate_limit_per_integration"`
108108

109-
AlertmanagerMaxConfigSizeBytes int `yaml:"alertmanager_max_config_size_bytes" json:"alertmanager_max_config_size_bytes"`
110-
AlertmanagerMaxTemplatesCount int `yaml:"alertmanager_max_templates_count" json:"alertmanager_max_templates_count"`
111-
AlertmanagerMaxTemplateSizeBytes int `yaml:"alertmanager_max_template_size_bytes" json:"alertmanager_max_template_size_bytes"`
112-
AlertmanagerMaxNumberOfDispatcherAggregationGroups int `yaml:"alertmanager_max_number_of_dispatcher_aggregation_groups" json:"alertmanager_max_number_of_dispatcher_aggregation_groups"`
109+
AlertmanagerMaxConfigSizeBytes int `yaml:"alertmanager_max_config_size_bytes" json:"alertmanager_max_config_size_bytes"`
110+
AlertmanagerMaxTemplatesCount int `yaml:"alertmanager_max_templates_count" json:"alertmanager_max_templates_count"`
111+
AlertmanagerMaxTemplateSizeBytes int `yaml:"alertmanager_max_template_size_bytes" json:"alertmanager_max_template_size_bytes"`
112+
AlertmanagerMaxDispatcherAggregationGroups int `yaml:"alertmanager_max_dispatcher_aggregation_groups" json:"alertmanager_max_dispatcher_aggregation_groups"`
113113
}
114114

115115
// RegisterFlags adds the flags required to config this to the given FlagSet
@@ -182,7 +182,7 @@ func (l *Limits) RegisterFlags(f *flag.FlagSet) {
182182
f.IntVar(&l.AlertmanagerMaxConfigSizeBytes, "alertmanager.max-config-size-bytes", 0, "Maximum size of configuration file for Alertmanager that tenant can upload via Alertmanager API. 0 = no limit.")
183183
f.IntVar(&l.AlertmanagerMaxTemplatesCount, "alertmanager.max-templates-count", 0, "Maximum number of templates in tenant's Alertmanager configuration uploaded via Alertmanager API. 0 = no limit.")
184184
f.IntVar(&l.AlertmanagerMaxTemplateSizeBytes, "alertmanager.max-template-size-bytes", 0, "Maximum size of single template in tenant's Alertmanager configuration uploaded via Alertmanager API. 0 = no limit.")
185-
f.IntVar(&l.AlertmanagerMaxNumberOfDispatcherAggregationGroups, "alertmanager.max-number-of-dispatcher-aggregation-groups", 0, "Maximum number of aggregation groups in Alertmanager's dispatcher that a tenant can have. Each active aggregation group uses single goroutine. When the limit is reached, dispatcher will not dispatch alerts that belong to additional aggregation groups, but existing groups will keep working properly. 0 = no limit.")
185+
f.IntVar(&l.AlertmanagerMaxDispatcherAggregationGroups, "alertmanager.max-dispatcher-aggregation-groups", 0, "Maximum number of aggregation groups in Alertmanager's dispatcher that a tenant can have. Each active aggregation group uses single goroutine. When the limit is reached, dispatcher will not dispatch alerts that belong to additional aggregation groups, but existing groups will keep working properly. 0 = no limit.")
186186
}
187187

188188
// Validate the limits config and returns an error if the validation
@@ -607,8 +607,8 @@ func (o *Overrides) AlertmanagerMaxTemplateSize(userID string) int {
607607
return o.getOverridesForUser(userID).AlertmanagerMaxTemplateSizeBytes
608608
}
609609

610-
func (o *Overrides) AlertmanagerMaxNumberOfDispatcherAggregationGroups(userID string) int {
611-
return o.getOverridesForUser(userID).AlertmanagerMaxNumberOfDispatcherAggregationGroups
610+
func (o *Overrides) AlertmanagerMaxDispatcherAggregationGroups(userID string) int {
611+
return o.getOverridesForUser(userID).AlertmanagerMaxDispatcherAggregationGroups
612612
}
613613

614614
func (o *Overrides) getOverridesForUser(userID string) *Limits {

0 commit comments

Comments
 (0)