Skip to content

Commit 0e91098

Browse files
authored
Mark instance limits as experimental. (#4096)
Signed-off-by: Peter Štibraný <peter.stibrany@grafana.com>
1 parent 206c9cd commit 0e91098

File tree

4 files changed

+13
-2
lines changed

4 files changed

+13
-2
lines changed

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@
3838
* [ENHANCEMENT] Allow use of `y|w|d` suffixes for duration related limits and per-tenant limits. #4044
3939
* [ENHANCEMENT] Query-frontend: Small optimization on top of PR #3968 to avoid unnecessary Extents merging. #4026
4040
* [ENHANCEMENT] Add a metric `cortex_compactor_compaction_interval_seconds` for the compaction interval config value. #4040
41-
* [ENHANCEMENT] Ingester: added following per-ingester (instance) limits: max number of series in memory (`-ingester.instance-limits.max-series`), max number of users in memory (`-ingester.instance-limits.max-tenants`), max ingestion rate (`-ingester.instance-limits.max-ingestion-rate`), and max inflight requests (`-ingester.instance-limits.max-inflight-push-requests`). These limits are only used when using blocks storage. Limits can also be configured using runtime-config feature, and current values are exported as `cortex_ingester_instance_limits` metric. #3992.
41+
* [ENHANCEMENT] Ingester: added following per-ingester (instance) experimental limits: max number of series in memory (`-ingester.instance-limits.max-series`), max number of users in memory (`-ingester.instance-limits.max-tenants`), max ingestion rate (`-ingester.instance-limits.max-ingestion-rate`), and max inflight requests (`-ingester.instance-limits.max-inflight-push-requests`). These limits are only used when using blocks storage. Limits can also be configured using runtime-config feature, and current values are exported as `cortex_ingester_instance_limits` metric. #3992.
4242
* [ENHANCEMENT] Cortex is now built with Go 1.16. #4062
43-
* [ENHANCEMENT] Distributor: added per-distributor limits: max number of inflight requests (`-distributor.instance-limits.max-inflight-push-requests`) and max ingestion rate in samples/sec (`-distributor.instance-limits.max-ingestion-rate`). If not set, these two are unlimited. Also added metrics to expose current values (`cortex_distributor_inflight_push_requests`, `cortex_distributor_ingestion_rate_samples_per_second`) as well as limits (`cortex_distributor_instance_limits` with various `limit` label values). #4071
43+
* [ENHANCEMENT] Distributor: added per-distributor experimental limits: max number of inflight requests (`-distributor.instance-limits.max-inflight-push-requests`) and max ingestion rate in samples/sec (`-distributor.instance-limits.max-ingestion-rate`). If not set, these two are unlimited. Also added metrics to expose current values (`cortex_distributor_inflight_push_requests`, `cortex_distributor_ingestion_rate_samples_per_second`) as well as limits (`cortex_distributor_instance_limits` with various `limit` label values). #4071
4444
* [ENHANCEMENT] Ruler: Added `-ruler.enabled-tenants` and `-ruler.disabled-tenants` to explicitly enable or disable rules processing for specific tenants. #4074
4545
* [ENHANCEMENT] Block Storage Ingester: `/flush` now accepts two new parameters: `tenant` to specify tenant to flush and `wait=true` to make call synchronous. Multiple tenants can be specified by repeating `tenant` parameter. If no `tenant` is specified, all tenants are flushed, as before. #4073
4646
* [ENHANCEMENT] Alertmanager: validate configured `-alertmanager.web.external-url` and fail if ends with `/`. #4081

docs/configuration/v1-guarantees.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,4 @@ Currently experimental features are:
7373
- Flags for configuring whether blocks-ingester streams samples or chunks are temporary, and will be removed when feature is tested:
7474
- `-ingester.stream-chunks-when-using-blocks` CLI flag
7575
- `ingester_stream_chunks_when_using_blocks` (boolean) field in runtime config file
76+
- Instance limits in ingester and distributor

pkg/distributor/distributor.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ import (
3333
"github.com/cortexproject/cortex/pkg/util"
3434
"github.com/cortexproject/cortex/pkg/util/extract"
3535
"github.com/cortexproject/cortex/pkg/util/limiter"
36+
util_log "github.com/cortexproject/cortex/pkg/util/log"
3637
util_math "github.com/cortexproject/cortex/pkg/util/math"
3738
"github.com/cortexproject/cortex/pkg/util/services"
3839
"github.com/cortexproject/cortex/pkg/util/validation"
@@ -342,6 +343,10 @@ func New(cfg Config, clientConfig ingester_client.Config, limits *validation.Ove
342343
}
343344

344345
func (d *Distributor) starting(ctx context.Context) error {
346+
if d.cfg.InstanceLimits != (InstanceLimits{}) {
347+
util_log.WarnExperimentalUse("distributor instance limits")
348+
}
349+
345350
// Only report success if all sub-services start properly
346351
return services.StartManagerAndAwaitHealthy(ctx, d.subservices)
347352
}

pkg/ingester/ingester_v2.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -637,6 +637,11 @@ func (i *Ingester) stoppingV2(_ error) error {
637637
}
638638

639639
func (i *Ingester) updateLoop(ctx context.Context) error {
640+
if limits := i.getInstanceLimits(); limits != nil && *limits != (InstanceLimits{}) {
641+
// This check will not cover enabling instance limits in runtime, but it will do for now.
642+
logutil.WarnExperimentalUse("ingester instance limits")
643+
}
644+
640645
rateUpdateTicker := time.NewTicker(i.cfg.RateUpdatePeriod)
641646
defer rateUpdateTicker.Stop()
642647

0 commit comments

Comments
 (0)