Skip to content

Commit 754a12f

Browse files
authored
Updated limits doc to reflect when 0 means disabled (#2934)
Signed-off-by: Marco Pracucci <[email protected]>
1 parent d439006 commit 754a12f

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

docs/configuration/config-file-reference.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2662,7 +2662,7 @@ The `limits_config` configures default and per-tenant limits imposed by Cortex s
26622662
26632663
# Minimum number of samples in an idle chunk to flush it to the store. Use with
26642664
# care, if chunks are less than this size they will be discarded. This option is
2665-
# ignored when running the Cortex blocks storage.
2665+
# ignored when running the Cortex blocks storage. 0 to disable.
26662666
# CLI flag: -ingester.min-chunk-length
26672667
[min_chunk_length: <int> | default = 0]
26682668
@@ -2686,7 +2686,7 @@ The `limits_config` configures default and per-tenant limits imposed by Cortex s
26862686
[max_global_metadata_per_metric: <int> | default = 0]
26872687
26882688
# Maximum number of chunks that can be fetched in a single query. This limit is
2689-
# enforced when fetching chunks from the long-term storage.
2689+
# enforced when fetching chunks from the long-term storage. 0 to disable.
26902690
# CLI flag: -store.query-chunk-limit
26912691
[max_chunks_per_query: <int> | default = 2000000]
26922692
@@ -2701,7 +2701,7 @@ The `limits_config` configures default and per-tenant limits imposed by Cortex s
27012701
[max_query_parallelism: <int> | default = 14]
27022702
27032703
# Cardinality limit for index queries. This limit is ignored when running the
2704-
# Cortex blocks storage.
2704+
# Cortex blocks storage. 0 to disable.
27052705
# CLI flag: -store.cardinality-limit
27062706
[cardinality_limit: <int> | default = 100000]
27072707

pkg/querier/queryrange/limits.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ func (l limits) Do(ctx context.Context, r Request) (Response, error) {
4343

4444
maxQueryLen := l.MaxQueryLength(userid)
4545
queryLen := timestamp.Time(r.GetEnd()).Sub(timestamp.Time(r.GetStart()))
46-
if maxQueryLen != 0 && queryLen > maxQueryLen {
46+
if maxQueryLen > 0 && queryLen > maxQueryLen {
4747
return nil, httpgrpc.Errorf(http.StatusBadRequest, validation.ErrQueryTooLong, queryLen, maxQueryLen)
4848
}
4949
return l.next.Do(ctx, r)

pkg/util/validation/limits.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,17 +93,17 @@ func (l *Limits) RegisterFlags(f *flag.FlagSet) {
9393
f.IntVar(&l.MaxLocalSeriesPerMetric, "ingester.max-series-per-metric", 50000, "The maximum number of active series per metric name, per ingester. 0 to disable.")
9494
f.IntVar(&l.MaxGlobalSeriesPerUser, "ingester.max-global-series-per-user", 0, "The maximum number of active series per user, across the cluster. 0 to disable. Supported only if -distributor.shard-by-all-labels is true.")
9595
f.IntVar(&l.MaxGlobalSeriesPerMetric, "ingester.max-global-series-per-metric", 0, "The maximum number of active series per metric name, across the cluster. 0 to disable.")
96-
f.IntVar(&l.MinChunkLength, "ingester.min-chunk-length", 0, "Minimum number of samples in an idle chunk to flush it to the store. Use with care, if chunks are less than this size they will be discarded. This option is ignored when running the Cortex blocks storage.")
96+
f.IntVar(&l.MinChunkLength, "ingester.min-chunk-length", 0, "Minimum number of samples in an idle chunk to flush it to the store. Use with care, if chunks are less than this size they will be discarded. This option is ignored when running the Cortex blocks storage. 0 to disable.")
9797

9898
f.IntVar(&l.MaxLocalMetricsWithMetadataPerUser, "ingester.max-metadata-per-user", 8000, "The maximum number of active metrics with metadata per user, per ingester. 0 to disable.")
9999
f.IntVar(&l.MaxLocalMetadataPerMetric, "ingester.max-metadata-per-metric", 10, "The maximum number of metadata per metric, per ingester. 0 to disable.")
100100
f.IntVar(&l.MaxGlobalMetricsWithMetadataPerUser, "ingester.max-global-metadata-per-user", 0, "The maximum number of active metrics with metadata per user, across the cluster. 0 to disable. Supported only if -distributor.shard-by-all-labels is true.")
101101
f.IntVar(&l.MaxGlobalMetadataPerMetric, "ingester.max-global-metadata-per-metric", 0, "The maximum number of metadata per metric, across the cluster. 0 to disable.")
102102

103-
f.IntVar(&l.MaxChunksPerQuery, "store.query-chunk-limit", 2e6, "Maximum number of chunks that can be fetched in a single query. This limit is enforced when fetching chunks from the long-term storage.")
103+
f.IntVar(&l.MaxChunksPerQuery, "store.query-chunk-limit", 2e6, "Maximum number of chunks that can be fetched in a single query. This limit is enforced when fetching chunks from the long-term storage. 0 to disable.")
104104
f.DurationVar(&l.MaxQueryLength, "store.max-query-length", 0, "Limit the query time range (end - start time). This limit is enforced in the query-frontend (on the received query), in the querier (on the query possibly split by the query-frontend) and in the chunks storage. 0 to disable.")
105105
f.IntVar(&l.MaxQueryParallelism, "querier.max-query-parallelism", 14, "Maximum number of queries will be scheduled in parallel by the frontend.")
106-
f.IntVar(&l.CardinalityLimit, "store.cardinality-limit", 1e5, "Cardinality limit for index queries. This limit is ignored when running the Cortex blocks storage.")
106+
f.IntVar(&l.CardinalityLimit, "store.cardinality-limit", 1e5, "Cardinality limit for index queries. This limit is ignored when running the Cortex blocks storage. 0 to disable.")
107107
f.DurationVar(&l.MaxCacheFreshness, "frontend.max-cache-freshness", 1*time.Minute, "Most recent allowed cacheable result per-tenant, to prevent caching very recent results that might still be in flux.")
108108

109109
f.StringVar(&l.PerTenantOverrideConfig, "limits.per-user-override-config", "", "File name of per-user overrides. [deprecated, use -runtime-config.file instead]")

0 commit comments

Comments
 (0)