From cd8199607b39f47aa1625d2ff3ff243552bf97f1 Mon Sep 17 00:00:00 2001 From: Nick Pillitteri Date: Thu, 16 Jan 2025 13:23:38 -0500 Subject: [PATCH 1/2] docs: Fix help text for query-frontend.prom2-range-compat flag From feedback https://github.com/grafana/mimir/pull/10459#discussion_r1918936622 Related #10445 Signed-off-by: Nick Pillitteri --- cmd/mimir/config-descriptor.json | 2 +- cmd/mimir/help-all.txt.tmpl | 2 +- .../sources/mimir/configure/configuration-parameters/index.md | 4 ++-- pkg/util/validation/limits.go | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cmd/mimir/config-descriptor.json b/cmd/mimir/config-descriptor.json index 76b262a7d2..f1d3895705 100644 --- a/cmd/mimir/config-descriptor.json +++ b/cmd/mimir/config-descriptor.json @@ -4352,7 +4352,7 @@ "kind": "field", "name": "prom2_range_compat", "required": false, - "desc": "Rewrite queries using the same range selector and resolution [X:X] which do not work in Prometheus 3 to a nearly identical form that does work with Prometheus 3 semantics", + "desc": "Rewrite queries using the same range selector and resolution [X:X] which don't work in Prometheus 3.0 to a nearly identical form that works with Prometheus 3.0 semantics", "fieldValue": null, "fieldDefaultValue": false, "fieldFlag": "query-frontend.prom2-range-compat", diff --git a/cmd/mimir/help-all.txt.tmpl b/cmd/mimir/help-all.txt.tmpl index add1270f85..f484c6afae 100644 --- a/cmd/mimir/help-all.txt.tmpl +++ b/cmd/mimir/help-all.txt.tmpl @@ -2290,7 +2290,7 @@ Usage of ./cmd/mimir/mimir: -query-frontend.parallelize-shardable-queries True to enable query sharding. -query-frontend.prom2-range-compat - [experimental] Rewrite queries using the same range selector and resolution [X:X] which do not work in Prometheus 3 to a nearly identical form that does work with Prometheus 3 semantics + [experimental] Rewrite queries using the same range selector and resolution [X:X] which don't work in Prometheus 3.0 to a nearly identical form that works with Prometheus 3.0 semantics -query-frontend.prune-queries [experimental] True to enable pruning dead code (eg. expressions that cannot produce any results) and simplifying expressions (eg. expressions that can be evaluated immediately) in queries. -query-frontend.querier-forget-delay duration diff --git a/docs/sources/mimir/configure/configuration-parameters/index.md b/docs/sources/mimir/configure/configuration-parameters/index.md index bd1a75bf5e..fc91ab5e03 100644 --- a/docs/sources/mimir/configure/configuration-parameters/index.md +++ b/docs/sources/mimir/configure/configuration-parameters/index.md @@ -3573,8 +3573,8 @@ The `limits` block configures default and per-tenant limits imposed by component [enabled_promql_experimental_functions: | default = ""] # (experimental) Rewrite queries using the same range selector and resolution -# [X:X] which do not work in Prometheus 3 to a nearly identical form that does -# work with Prometheus 3 semantics +# [X:X] which don't work in Prometheus 3.0 to a nearly identical form that works +# with Prometheus 3.0 semantics # CLI flag: -query-frontend.prom2-range-compat [prom2_range_compat: | default = false] diff --git a/pkg/util/validation/limits.go b/pkg/util/validation/limits.go index 489877ff7d..3dcc3060f2 100644 --- a/pkg/util/validation/limits.go +++ b/pkg/util/validation/limits.go @@ -377,7 +377,7 @@ func (l *Limits) RegisterFlags(f *flag.FlagSet) { f.IntVar(&l.MaxQueryExpressionSizeBytes, MaxQueryExpressionSizeBytesFlag, 0, "Max size of the raw query, in bytes. This limit is enforced by the query-frontend for instant, range and remote read queries. 0 to not apply a limit to the size of the query.") f.BoolVar(&l.AlignQueriesWithStep, alignQueriesWithStepFlag, false, "Mutate incoming queries to align their start and end with their step to improve result caching.") f.Var(&l.EnabledPromQLExperimentalFunctions, "query-frontend.enabled-promql-experimental-functions", "Enable certain experimental PromQL functions, which are subject to being changed or removed at any time, on a per-tenant basis. Defaults to empty which means all experimental functions are disabled. Set to 'all' to enable all experimental functions.") - f.BoolVar(&l.Prom2RangeCompat, "query-frontend.prom2-range-compat", false, "Rewrite queries using the same range selector and resolution [X:X] which do not work in Prometheus 3 to a nearly identical form that does work with Prometheus 3 semantics") + f.BoolVar(&l.Prom2RangeCompat, "query-frontend.prom2-range-compat", false, "Rewrite queries using the same range selector and resolution [X:X] which don't work in Prometheus 3.0 to a nearly identical form that works with Prometheus 3.0 semantics") // Store-gateway. f.IntVar(&l.StoreGatewayTenantShardSize, "store-gateway.tenant-shard-size", 0, "The tenant's shard size, used when store-gateway sharding is enabled. Value of 0 disables shuffle sharding for the tenant, that is all tenant blocks are sharded across all store-gateway replicas.") From 8065724ed6a9f5b3fc173317ef4fe055904f12c5 Mon Sep 17 00:00:00 2001 From: Nick Pillitteri Date: Thu, 16 Jan 2025 13:25:26 -0500 Subject: [PATCH 2/2] Changelog Signed-off-by: Nick Pillitteri --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 401bcd4dd2..81b5c24ae2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,7 +32,7 @@ * [BUGFIX] PromQL: Fix functions with histograms https://github.com/prometheus/prometheus/pull/15711 #10400 * [BUGFIX] MQE: Fix functions with histograms #10400 * [BUGFIX] Distributor: return HTTP status 415 Unsupported Media Type instead of 200 Success for Remote Write 2.0 until we support it. #10423 -* [BUGFIX] Query-frontend: Add flag `-query-frontend.prom2-range-compat` and corresponding YAML to rewrite queries with ranges that worked in Prometheus 2 but are invalid in Prometheus 3. #10445 +* [BUGFIX] Query-frontend: Add flag `-query-frontend.prom2-range-compat` and corresponding YAML to rewrite queries with ranges that worked in Prometheus 2 but are invalid in Prometheus 3. #10445 #10461 ### Mixin