Skip to content

Commit 02254ea

Browse files
authored
Removing deprecated chunk storage flag (#5940)
* Removing deprecated chunk storage flag Signed-off-by: alanprot <[email protected]> * lint Signed-off-by: alanprot <[email protected]> --------- Signed-off-by: alanprot <[email protected]>
1 parent af97ee3 commit 02254ea

File tree

5 files changed

+3
-23
lines changed

5 files changed

+3
-23
lines changed

docs/configuration/config-file-reference.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3148,14 +3148,6 @@ The `limits_config` configures default and per-tenant limits imposed by Cortex s
31483148
# CLI flag: -ingester.max-exemplars
31493149
[max_exemplars: <int> | default = 0]
31503150
3151-
# The maximum number of series for which a query can fetch samples from each
3152-
# ingester. This limit is enforced only in the ingesters (when querying samples
3153-
# not flushed to the storage yet) and it's a per-instance limit. This limit is
3154-
# ignored when running the Cortex blocks storage. When running Cortex with
3155-
# blocks storage use -querier.max-fetched-series-per-query limit instead.
3156-
# CLI flag: -ingester.max-series-per-query
3157-
[max_series_per_query: <int> | default = 100000]
3158-
31593151
# The maximum number of active series per user, per ingester. 0 to disable.
31603152
# CLI flag: -ingester.max-series-per-user
31613153
[max_series_per_user: <int> | default = 5000000]

pkg/cortex/runtime_config_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ overrides:
2222
max_global_series_per_metric: 7000
2323
max_global_series_per_user: 15000
2424
max_series_per_metric: 0
25-
max_series_per_query: 30000
2625
max_series_per_user: 0
2726
ruler_max_rule_groups_per_tenant: 20
2827
ruler_max_rules_per_rule_group: 20
@@ -37,7 +36,6 @@ overrides:
3736
IngestionBurstSize: 15000,
3837
MaxGlobalSeriesPerUser: 15000,
3938
MaxGlobalSeriesPerMetric: 7000,
40-
MaxSeriesPerQuery: 30000,
4139
RulerMaxRulesPerRuleGroup: 20,
4240
RulerMaxRuleGroupsPerTenant: 20,
4341
}

pkg/ingester/limiter.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,6 @@ func (l *Limiter) AssertMaxMetricsWithMetadataPerUser(userID string, metrics int
9797
return errMaxMetadataPerUserLimitExceeded
9898
}
9999

100-
// MaxSeriesPerQuery returns the maximum number of series a query is allowed to hit.
101-
func (l *Limiter) MaxSeriesPerQuery(userID string) int {
102-
return l.limits.MaxSeriesPerQuery(userID)
103-
}
104-
105100
// FormatError returns the input error enriched with the actual limits for the given user.
106101
// It acts as pass-through if the input error is unknown.
107102
func (l *Limiter) FormatError(userID string, err error) error {

pkg/util/validation/exporter.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ func (oe *OverridesExporter) Collect(ch chan<- prometheus.Metric) {
3434
ch <- prometheus.MustNewConstMetric(oe.description, prometheus.GaugeValue, limits.IngestionRate, "ingestion_rate", tenant)
3535
ch <- prometheus.MustNewConstMetric(oe.description, prometheus.GaugeValue, float64(limits.IngestionBurstSize), "ingestion_burst_size", tenant)
3636

37-
ch <- prometheus.MustNewConstMetric(oe.description, prometheus.GaugeValue, float64(limits.MaxSeriesPerQuery), "max_series_per_query", tenant)
3837
ch <- prometheus.MustNewConstMetric(oe.description, prometheus.GaugeValue, float64(limits.MaxLocalSeriesPerUser), "max_local_series_per_user", tenant)
3938
ch <- prometheus.MustNewConstMetric(oe.description, prometheus.GaugeValue, float64(limits.MaxLocalSeriesPerMetric), "max_local_series_per_metric", tenant)
4039
ch <- prometheus.MustNewConstMetric(oe.description, prometheus.GaugeValue, float64(limits.MaxGlobalSeriesPerUser), "max_global_series_per_user", tenant)

pkg/util/validation/limits.go

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import (
1616
"golang.org/x/time/rate"
1717

1818
"github.com/cortexproject/cortex/pkg/util/flagext"
19+
util_log "github.com/cortexproject/cortex/pkg/util/log"
1920
)
2021

2122
var errMaxGlobalSeriesPerUserValidation = errors.New("The ingester.max-global-series-per-user limit is unsupported if distributor.shard-by-all-labels is disabled")
@@ -101,7 +102,6 @@ type Limits struct {
101102

102103
// Ingester enforced limits.
103104
// Series
104-
MaxSeriesPerQuery int `yaml:"max_series_per_query" json:"max_series_per_query"`
105105
MaxLocalSeriesPerUser int `yaml:"max_series_per_user" json:"max_series_per_user"`
106106
MaxLocalSeriesPerMetric int `yaml:"max_series_per_metric" json:"max_series_per_metric"`
107107
MaxGlobalSeriesPerUser int `yaml:"max_global_series_per_user" json:"max_global_series_per_user"`
@@ -171,6 +171,8 @@ type Limits struct {
171171

172172
// RegisterFlags adds the flags required to config this to the given FlagSet
173173
func (l *Limits) RegisterFlags(f *flag.FlagSet) {
174+
flagext.DeprecatedFlag(f, "ingester.max-series-per-query", "Deprecated: The maximum number of series for which a query can fetch samples from each ingester. This limit is enforced only in the ingesters (when querying samples not flushed to the storage yet) and it's a per-instance limit. This limit is ignored when running the Cortex blocks storage. When running Cortex with blocks storage use -querier.max-fetched-series-per-query limit instead.", util_log.Logger)
175+
174176
f.IntVar(&l.IngestionTenantShardSize, "distributor.ingestion-tenant-shard-size", 0, "The default tenant's shard size when the shuffle-sharding strategy is used. Must be set both on ingesters and distributors. When this setting is specified in the per-tenant overrides, a value of 0 disables shuffle sharding for the tenant.")
175177
f.Float64Var(&l.IngestionRate, "distributor.ingestion-rate-limit", 25000, "Per-user ingestion rate limit in samples per second.")
176178
f.StringVar(&l.IngestionRateStrategy, "distributor.ingestion-rate-limit-strategy", "local", "Whether the ingestion rate limit should be applied individually to each distributor instance (local), or evenly shared across the cluster (global).")
@@ -193,7 +195,6 @@ func (l *Limits) RegisterFlags(f *flag.FlagSet) {
193195
f.BoolVar(&l.EnforceMetricName, "validation.enforce-metric-name", true, "Enforce every sample has a metric name.")
194196
f.BoolVar(&l.EnforceMetadataMetricName, "validation.enforce-metadata-metric-name", true, "Enforce every metadata has a metric name.")
195197

196-
f.IntVar(&l.MaxSeriesPerQuery, "ingester.max-series-per-query", 100000, "The maximum number of series for which a query can fetch samples from each ingester. This limit is enforced only in the ingesters (when querying samples not flushed to the storage yet) and it's a per-instance limit. This limit is ignored when running the Cortex blocks storage. When running Cortex with blocks storage use -querier.max-fetched-series-per-query limit instead.")
197198
f.IntVar(&l.MaxLocalSeriesPerUser, "ingester.max-series-per-user", 5000000, "The maximum number of active series per user, per ingester. 0 to disable.")
198199
f.IntVar(&l.MaxLocalSeriesPerMetric, "ingester.max-series-per-metric", 50000, "The maximum number of active series per metric name, per ingester. 0 to disable.")
199200
f.IntVar(&l.MaxGlobalSeriesPerUser, "ingester.max-global-series-per-user", 0, "The maximum number of active series per user, across the cluster before replication. 0 to disable. Supported only if -distributor.shard-by-all-labels is true.")
@@ -493,11 +494,6 @@ func (o *Overrides) CreationGracePeriod(userID string) time.Duration {
493494
return time.Duration(o.GetOverridesForUser(userID).CreationGracePeriod)
494495
}
495496

496-
// MaxSeriesPerQuery returns the maximum number of series a query is allowed to hit.
497-
func (o *Overrides) MaxSeriesPerQuery(userID string) int {
498-
return o.GetOverridesForUser(userID).MaxSeriesPerQuery
499-
}
500-
501497
// MaxLocalSeriesPerUser returns the maximum number of series a user is allowed to store in a single ingester.
502498
func (o *Overrides) MaxLocalSeriesPerUser(userID string) int {
503499
return o.GetOverridesForUser(userID).MaxLocalSeriesPerUser

0 commit comments

Comments
 (0)