Skip to content

Commit f4693b7

Browse files
committed
Add distributor.shard-by-all-labels to Deprecated flag
Signed-off-by: tesla59 <nishant@heim.id>
1 parent e75d171 commit f4693b7

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
lines changed

docs/configuration/arguments.md

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -89,16 +89,6 @@ The next three options only apply when the querier is used together with the Que
8989

9090
## Distributor
9191

92-
- `-distributor.shard-by-all-labels` (Deprecated and removed)
93-
94-
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.
95-
96-
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.
97-
98-
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.
99-
100-
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.
101-
10292
- `-distributor.extra-query-delay`
10393
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.
10494

pkg/distributor/distributor.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ import (
3434
"github.com/cortexproject/cortex/pkg/tenant"
3535
"github.com/cortexproject/cortex/pkg/util"
3636
"github.com/cortexproject/cortex/pkg/util/extract"
37+
"github.com/cortexproject/cortex/pkg/util/flagext"
3738
"github.com/cortexproject/cortex/pkg/util/limiter"
3839
util_log "github.com/cortexproject/cortex/pkg/util/log"
3940
util_math "github.com/cortexproject/cortex/pkg/util/math"
@@ -186,6 +187,8 @@ func (cfg *Config) RegisterFlags(f *flag.FlagSet) {
186187

187188
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.")
188189
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.")
190+
191+
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)
189192
}
190193

191194
// Validate config and returns error on failure

0 commit comments

Comments
 (0)