Skip to content

Commit

Permalink
Clean up deprecated features for 2.14 (#9407) (#9426)
Browse files Browse the repository at this point in the history
* ingester, distributor: remove deprecated limit-inflight-requests-using-grpc-method-limiter

Signed-off-by: Vladimir Varankin <vladimir.varankin@grafana.com>

* querier: remove deprecated -querier.max-query-into-future

Signed-off-by: Vladimir Varankin <vladimir.varankin@grafana.com>

* update CHANGELOG

Signed-off-by: Vladimir Varankin <vladimir.varankin@grafana.com>

* rebuild assets

Signed-off-by: Vladimir Varankin <vladimir.varankin@grafana.com>

---------

Signed-off-by: Vladimir Varankin <vladimir.varankin@grafana.com>
(cherry picked from commit 286c23c)

Co-authored-by: Vladimir Varankin <vladimir.varankin@grafana.com>
  • Loading branch information
grafanabot and narqo committed Sep 26, 2024
1 parent 5574795 commit 2a82d01
Show file tree
Hide file tree
Showing 11 changed files with 212 additions and 373 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
* [CHANGE] Querier: allow wrapping errors with context errors only when the former actually correspond to `context.Canceled` and `context.DeadlineExceeded`. #9175
* [CHANGE] Query-scheduler: Remove the experimental `-query-scheduler.use-multi-algorithm-query-queue` flag. The new multi-algorithm tree queue is always used for the scheduler. #9210
* [CHANGE] Distributor: reject incoming requests until the distributor service has started. #9317
* [CHANGE] Ingester, Distributor: Remove deprecated `-ingester.limit-inflight-requests-using-grpc-method-limiter` and `-distributor.limit-inflight-requests-using-grpc-method-limiter`. The feature was deprecated and enabled by default in Mimir 2.12. #9407
* [CHANGE] Querier: Remove deprecated `-querier.max-query-into-future`. The feature was deprecated in Mimir 2.12. #9407
* [FEATURE] Alertmanager: Added `-alertmanager.log-parsing-label-matchers` to control logging when parsing label matchers. This flag is intended to be used with `-alertmanager.utf8-strict-mode-enabled` to validate UTF-8 strict mode is working as intended. The default value is `false`. #9173
* [FEATURE] Alertmanager: Added `-alertmanager.utf8-migration-logging-enabled` to enable logging of tenant configurations that are incompatible with UTF-8 strict mode. The default value is `false`. #9174
* [FEATURE] Querier: add experimental streaming PromQL engine, enabled with `-querier.query-engine=mimir`. #8422 #8430 #8454 #8455 #8360 #8490 #8508 #8577 #8660 #8671 #8677 #8747 #8850 #8872 #8838 #8911 #8909 #8923 #8924 #8925 #8932 #8933 #8934 #8962 #8986 #8993 #8995 #9008 #9017 #9018 #9019 #9120 #9121 #9136 #9139 #9140 #9145 #9191 #9192 #9194 #9196 #9201 #9212 #9225 #9260 #9272 #9277 #9278 #9280 #9281 #9342 #9343 #9371
Expand Down
33 changes: 0 additions & 33 deletions cmd/mimir/config-descriptor.json
Original file line number Diff line number Diff line change
Expand Up @@ -1680,17 +1680,6 @@
"fieldType": "boolean",
"fieldCategory": "experimental"
},
{
"kind": "field",
"name": "limit_inflight_requests_using_grpc_method_limiter",
"required": false,
"desc": "When enabled, in-flight write requests limit is checked as soon as the gRPC request is received, before the request is decoded and parsed.",
"fieldValue": null,
"fieldDefaultValue": true,
"fieldFlag": "distributor.limit-inflight-requests-using-grpc-method-limiter",
"fieldType": "boolean",
"fieldCategory": "deprecated"
},
{
"kind": "field",
"name": "reusable_ingester_push_workers",
Expand Down Expand Up @@ -1734,17 +1723,6 @@
"fieldType": "duration",
"fieldCategory": "advanced"
},
{
"kind": "field",
"name": "max_query_into_future",
"required": false,
"desc": "Maximum duration into the future you can query. 0 to disable.",
"fieldValue": null,
"fieldDefaultValue": 600000000000,
"fieldFlag": "querier.max-query-into-future",
"fieldType": "duration",
"fieldCategory": "deprecated"
},
{
"kind": "block",
"name": "store_gateway_client",
Expand Down Expand Up @@ -3425,17 +3403,6 @@
"fieldType": "boolean",
"fieldCategory": "experimental"
},
{
"kind": "field",
"name": "limit_inflight_requests_using_grpc_method_limiter",
"required": false,
"desc": "When enabled, in-flight write requests limit is checked as soon as the gRPC request is received, before the request is decoded and parsed.",
"fieldValue": null,
"fieldDefaultValue": true,
"fieldFlag": "ingester.limit-inflight-requests-using-grpc-method-limiter",
"fieldType": "boolean",
"fieldCategory": "deprecated"
},
{
"kind": "field",
"name": "error_sample_rate",
Expand Down
6 changes: 0 additions & 6 deletions cmd/mimir/help-all.txt.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -1227,8 +1227,6 @@ Usage of ./cmd/mimir/mimir:
The sum of the request sizes in bytes of inflight push requests that this distributor can handle. This limit is per-distributor, not per-tenant. Additional requests will be rejected. 0 = unlimited.
-distributor.instance-limits.max-ingestion-rate float
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.
-distributor.limit-inflight-requests-using-grpc-method-limiter
[deprecated] When enabled, in-flight write requests limit is checked as soon as the gRPC request is received, before the request is decoded and parsed. (default true)
-distributor.max-exemplars-per-series-per-request int
[experimental] Maximum number of exemplars per series per request. 0 to disable limit in request. The exceeding exemplars are dropped.
-distributor.max-otlp-request-size int
Expand Down Expand Up @@ -1455,8 +1453,6 @@ Usage of ./cmd/mimir/mimir:
Max series that this ingester can hold (across all tenants). Requests to create additional series will be rejected. 0 = unlimited.
-ingester.instance-limits.max-tenants int
Max tenants that this ingester can hold. Requests from additional tenants will be rejected. 0 = unlimited.
-ingester.limit-inflight-requests-using-grpc-method-limiter
[deprecated] When enabled, in-flight write requests limit is checked as soon as the gRPC request is received, before the request is decoded and parsed. (default true)
-ingester.log-utilization-based-limiter-cpu-samples
[experimental] Enable logging of utilization based limiter CPU samples.
-ingester.max-global-exemplars-per-user int
Expand Down Expand Up @@ -1917,8 +1913,6 @@ Usage of ./cmd/mimir/mimir:
Maximum number of outstanding requests per tenant per frontend; requests beyond this error with HTTP 429. (default 100)
-querier.max-partial-query-length duration
Limit the time range for partial queries at the querier level.
-querier.max-query-into-future duration
[deprecated] Maximum duration into the future you can query. 0 to disable. (default 10m0s)
-querier.max-query-lookback duration
Limit how long back data (series and metadata) can be queried, up until <lookback> duration ago. This limit is enforced in the query-frontend, querier and ruler for instant, range and remote read queries. For metadata queries like series, label names, label values queries the limit is enforced in the querier and ruler. If the requested time range is outside the allowed range, the request will not fail but will be manipulated to only query data within the allowed time range. 0 to disable.
-querier.max-query-parallelism int
Expand Down
6 changes: 3 additions & 3 deletions cmd/mimir/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,12 @@ func TestFlagParsing(t *testing.T) {
defaults := mimir.Config{}
flagext.DefaultValues(&defaults)

require.NotZero(t, defaults.Querier.MaxQueryIntoFuture,
"This test asserts that mimir.Config.Querier.MaxQueryIntoFuture default value is not zero. "+
require.NotZero(t, defaults.Querier.QueryStoreAfter,
"This test asserts that mimir.Config.Querier.QueryStoreAfter default value is not zero. "+
"If it's zero, this test is useless. Please change it to use a config value with a non-zero default.",
)

require.Equal(t, cfg.Querier.MaxQueryIntoFuture, defaults.Querier.MaxQueryIntoFuture,
require.Equal(t, cfg.Querier.QueryStoreAfter, defaults.Querier.QueryStoreAfter,
"YAML parser has set the [entire] Querier config to zero values by specifying an empty node."+
"If this happens again, check git history on how this was checked with previous YAML parser implementation.")
},
Expand Down
14 changes: 0 additions & 14 deletions docs/sources/mimir/configure/configuration-parameters/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -948,11 +948,6 @@ instance_limits:
# CLI flag: -distributor.write-requests-buffer-pooling-enabled
[write_requests_buffer_pooling_enabled: <boolean> | default = true]
# (deprecated) When enabled, in-flight write requests limit is checked as soon
# as the gRPC request is received, before the request is decoded and parsed.
# CLI flag: -distributor.limit-inflight-requests-using-grpc-method-limiter
[limit_inflight_requests_using_grpc_method_limiter: <boolean> | default = true]
# (advanced) Number of pre-allocated workers used to forward push requests to
# the ingesters. If 0, no workers will be used and a new goroutine will be
# spawned for each ingester push request. If not enough workers available, new
Expand Down Expand Up @@ -1251,11 +1246,6 @@ instance_limits:
# CLI flag: -ingester.log-utilization-based-limiter-cpu-samples
[log_utilization_based_limiter_cpu_samples: <boolean> | default = false]
# (deprecated) When enabled, in-flight write requests limit is checked as soon
# as the gRPC request is received, before the request is decoded and parsed.
# CLI flag: -ingester.limit-inflight-requests-using-grpc-method-limiter
[limit_inflight_requests_using_grpc_method_limiter: <boolean> | default = true]
# (advanced) Each error will be logged once in this many times. Use 0 to log all
# of them.
# CLI flag: -ingester.error-sample-rate
Expand Down Expand Up @@ -1365,10 +1355,6 @@ The `querier` block configures the querier.
# CLI flag: -querier.query-store-after
[query_store_after: <duration> | default = 12h]
# (deprecated) Maximum duration into the future you can query. 0 to disable.
# CLI flag: -querier.max-query-into-future
[max_query_into_future: <duration> | default = 10m]
store_gateway_client:
# (advanced) Enable TLS for gRPC client connecting to store-gateway.
# CLI flag: -querier.store-gateway-client.tls-enabled
Expand Down
6 changes: 2 additions & 4 deletions pkg/distributor/distributor.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,8 @@ type Config struct {
// These functions will only receive samples that don't get dropped by HA deduplication.
PushWrappers []PushWrapper `yaml:"-"`

WriteRequestsBufferPoolingEnabled bool `yaml:"write_requests_buffer_pooling_enabled" category:"experimental"`
LimitInflightRequestsUsingGrpcMethodLimiter bool `yaml:"limit_inflight_requests_using_grpc_method_limiter" category:"deprecated"` // TODO Remove the configuration option in Mimir 2.14, keeping the same behavior as if it's enabled
ReusableIngesterPushWorkers int `yaml:"reusable_ingester_push_workers" category:"advanced"`
WriteRequestsBufferPoolingEnabled bool `yaml:"write_requests_buffer_pooling_enabled" category:"experimental"`
ReusableIngesterPushWorkers int `yaml:"reusable_ingester_push_workers" category:"advanced"`

// DirectOTLPTranslationEnabled allows reverting to the older way of translating from OTLP write requests via Prometheus, in case of problems.
DirectOTLPTranslationEnabled bool `yaml:"direct_otlp_translation_enabled" category:"experimental"`
Expand All @@ -243,7 +242,6 @@ func (cfg *Config) RegisterFlags(f *flag.FlagSet, logger log.Logger) {
f.IntVar(&cfg.MaxRequestPoolBufferSize, "distributor.max-request-pool-buffer-size", 0, "Max size of the pooled buffers used for marshaling write requests. If 0, no max size is enforced.")
f.DurationVar(&cfg.RemoteTimeout, "distributor.remote-timeout", 2*time.Second, "Timeout for downstream ingesters.")
f.BoolVar(&cfg.WriteRequestsBufferPoolingEnabled, "distributor.write-requests-buffer-pooling-enabled", true, "Enable pooling of buffers used for marshaling write requests.")
f.BoolVar(&cfg.LimitInflightRequestsUsingGrpcMethodLimiter, "distributor.limit-inflight-requests-using-grpc-method-limiter", true, "When enabled, in-flight write requests limit is checked as soon as the gRPC request is received, before the request is decoded and parsed.")
f.IntVar(&cfg.ReusableIngesterPushWorkers, "distributor.reusable-ingester-push-workers", 2000, "Number of pre-allocated workers used to forward push requests to the ingesters. If 0, no workers will be used and a new goroutine will be spawned for each ingester push request. If not enough workers available, new goroutine will be spawned. (Note: this is a performance optimization, not a limiting feature.)")
f.BoolVar(&cfg.DirectOTLPTranslationEnabled, "distributor.direct-otlp-translation-enabled", true, "When enabled, OTLP write requests are directly translated to Mimir equivalents, for optimum performance.")

Expand Down
5 changes: 1 addition & 4 deletions pkg/ingester/ingester.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,6 @@ type Config struct {
ReadPathMemoryUtilizationLimit uint64 `yaml:"read_path_memory_utilization_limit" category:"experimental"`
LogUtilizationBasedLimiterCPUSamples bool `yaml:"log_utilization_based_limiter_cpu_samples" category:"experimental"`

LimitInflightRequestsUsingGrpcMethodLimiter bool `yaml:"limit_inflight_requests_using_grpc_method_limiter" category:"deprecated"` // TODO Remove the configuration option in Mimir 2.14, keeping the same behavior as if it's enabled.

ErrorSampleRate int64 `yaml:"error_sample_rate" json:"error_sample_rate" category:"advanced"`

UseIngesterOwnedSeriesForLimits bool `yaml:"use_ingester_owned_series_for_limits" category:"experimental"`
Expand Down Expand Up @@ -236,7 +234,6 @@ func (cfg *Config) RegisterFlags(f *flag.FlagSet, logger log.Logger) {
f.Float64Var(&cfg.ReadPathCPUUtilizationLimit, "ingester.read-path-cpu-utilization-limit", 0, "CPU utilization limit, as CPU cores, for CPU/memory utilization based read request limiting. Use 0 to disable it.")
f.Uint64Var(&cfg.ReadPathMemoryUtilizationLimit, "ingester.read-path-memory-utilization-limit", 0, "Memory limit, in bytes, for CPU/memory utilization based read request limiting. Use 0 to disable it.")
f.BoolVar(&cfg.LogUtilizationBasedLimiterCPUSamples, "ingester.log-utilization-based-limiter-cpu-samples", false, "Enable logging of utilization based limiter CPU samples.")
f.BoolVar(&cfg.LimitInflightRequestsUsingGrpcMethodLimiter, "ingester.limit-inflight-requests-using-grpc-method-limiter", true, "When enabled, in-flight write requests limit is checked as soon as the gRPC request is received, before the request is decoded and parsed.")
f.Int64Var(&cfg.ErrorSampleRate, "ingester.error-sample-rate", 10, "Each error will be logged once in this many times. Use 0 to log all of them.")
f.BoolVar(&cfg.UseIngesterOwnedSeriesForLimits, "ingester.use-ingester-owned-series-for-limits", false, "When enabled, only series currently owned by ingester according to the ring are used when checking user per-tenant series limit.")
f.BoolVar(&cfg.UpdateIngesterOwnedSeries, "ingester.track-ingester-owned-series", false, "This option enables tracking of ingester-owned series based on ring state, even if -ingester.use-ingester-owned-series-for-limits is disabled.")
Expand Down Expand Up @@ -1088,7 +1085,7 @@ func (i *Ingester) PushWithCleanup(ctx context.Context, req *mimirpb.WriteReques
// Only start/finish request here when the request comes NOT from grpc handlers (i.e., from ingest.Store).
// NOTE: request coming from grpc handler may end up calling start multiple times during its lifetime (e.g., when migrating to ingest storage).
// startPushRequest handles this.
if i.cfg.IngestStorageConfig.Enabled || !i.cfg.LimitInflightRequestsUsingGrpcMethodLimiter {
if i.cfg.IngestStorageConfig.Enabled {
reqSize := int64(req.Size())
var (
shouldFinish bool
Expand Down
Loading

0 comments on commit 2a82d01

Please sign in to comment.