diff --git a/docs/configuration/arguments.md b/docs/configuration/arguments.md index fc074c09b3d..a6f03517355 100644 --- a/docs/configuration/arguments.md +++ b/docs/configuration/arguments.md @@ -89,16 +89,6 @@ The next three options only apply when the querier is used together with the Que ## Distributor -- `-distributor.shard-by-all-labels` (Deprecated and removed) - - In the original Cortex design, samples were sharded amongst distributors by the combination of (userid, metric name). Sharding by metric name was designed to reduce the number of ingesters you need to hit on the read path; the downside was that you could hotspot the write path. - - Sharding by all labels is now the default behavior to improve load balancing and support for very high cardinality metrics. This ensures that writes are distributed more evenly across ingesters, which is more important than optimizing for reads, as ingester reads are in-memory and cheap. - - Upgrade notes: Cortex now always shards by all labels, ensuring better load balancing among ingesters. There is no need for any specific upgrade steps, as this is the default behavior. - - Warning: The -distributor.shard-by-all-labels flag has been removed, as disabling sharding by all labels can lead to an imbalanced distribution of load among the ingesters, which is undesirable. - - `-distributor.extra-query-delay` This is used by a component with an embedded distributor (Querier and Ruler) to control how long to wait until sending more than the minimum amount of queries needed for a successful response. diff --git a/pkg/distributor/distributor.go b/pkg/distributor/distributor.go index 1cb9254ce4f..c0ed7054f47 100644 --- a/pkg/distributor/distributor.go +++ b/pkg/distributor/distributor.go @@ -34,6 +34,7 @@ import ( "github.com/cortexproject/cortex/pkg/tenant" "github.com/cortexproject/cortex/pkg/util" "github.com/cortexproject/cortex/pkg/util/extract" + "github.com/cortexproject/cortex/pkg/util/flagext" "github.com/cortexproject/cortex/pkg/util/limiter" util_log "github.com/cortexproject/cortex/pkg/util/log" util_math "github.com/cortexproject/cortex/pkg/util/math" @@ -186,6 +187,8 @@ func (cfg *Config) RegisterFlags(f *flag.FlagSet) { f.Float64Var(&cfg.InstanceLimits.MaxIngestionRate, "distributor.instance-limits.max-ingestion-rate", 0, "Max ingestion rate (samples/sec) that this distributor will accept. This limit is per-distributor, not per-tenant. Additional push requests will be rejected. Current ingestion rate is computed as exponentially weighted moving average, updated every second. 0 = unlimited.") f.IntVar(&cfg.InstanceLimits.MaxInflightPushRequests, "distributor.instance-limits.max-inflight-push-requests", 0, "Max inflight push requests that this distributor can handle. This limit is per-distributor, not per-tenant. Additional requests will be rejected. 0 = unlimited.") + + flagext.DeprecatedFlag(f, "distributor.shard-by-all-labels", "Deprecated: This should be enabled because disabling it can produces imbalanced ingesters, which is never desirable", util_log.Logger) } // Validate config and returns error on failure