diff --git a/CHANGELOG.md b/CHANGELOG.md index 5294355905..737aeee788 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,7 @@ We use *breaking :warning:* to mark changes that are not backward compatible (re - [#5218](https://github.com/thanos-io/thanos/pull/5218) Tools: Run bucket downsample tools continuously. - [#5224](https://github.com/thanos-io/thanos/pull/5224) Receive: Remove sort on label hashing - [#5231](https://github.com/thanos-io/thanos/pull/5231) Tools: Bucket verify tool ignores blocks with deletion markers. +- [#5244](https://github.com/thanos-io/thanos/pull/5244) Query: Promote negative offset and `@` modifier to stable features as per Prometheus [#10121](https://github.com/prometheus/prometheus/pull/10121). ### Removed diff --git a/cmd/thanos/query.go b/cmd/thanos/query.go index 25f7c61133..f40ebed775 100644 --- a/cmd/thanos/query.go +++ b/cmd/thanos/query.go @@ -161,7 +161,7 @@ func registerQuery(app *extkingpin.App) { enableMetricMetadataPartialResponse := cmd.Flag("metric-metadata.partial-response", "Enable partial response for metric metadata endpoint. --no-metric-metadata.partial-response for disabling."). Hidden().Default("true").Bool() - featureList := cmd.Flag("enable-feature", "Comma separated experimental feature names to enable.The current list of features is "+promqlNegativeOffset+", "+promqlAtModifier+" and "+queryPushdown+".").Default("").Strings() + featureList := cmd.Flag("enable-feature", "Comma separated experimental feature names to enable.The current list of features is "+queryPushdown+".").Default("").Strings() enableExemplarPartialResponse := cmd.Flag("exemplar.partial-response", "Enable partial response for exemplar endpoint. --no-exemplar.partial-response for disabling."). Hidden().Default("true").Bool() @@ -182,16 +182,16 @@ func registerQuery(app *extkingpin.App) { return errors.Wrap(err, "parse federation labels") } - var enableNegativeOffset, enableAtModifier, enableQueryPushdown bool + var enableQueryPushdown bool for _, feature := range *featureList { - if feature == promqlNegativeOffset { - enableNegativeOffset = true + if feature == queryPushdown { + enableQueryPushdown = true } if feature == promqlAtModifier { - enableAtModifier = true + level.Warn(logger).Log("msg", "This option for --enable-feature is now permanently enabled and therefore a no-op.", "option", promqlAtModifier) } - if feature == queryPushdown { - enableQueryPushdown = true + if feature == promqlNegativeOffset { + level.Warn(logger).Log("msg", "This option for --enable-feature is now permanently enabled and therefore a no-op.", "option", promqlNegativeOffset) } } @@ -280,8 +280,6 @@ func registerQuery(app *extkingpin.App) { *strictStores, *strictEndpoints, *webDisableCORS, - enableAtModifier, - enableNegativeOffset, enableQueryPushdown, *alertQueryURL, component.Query, @@ -349,8 +347,6 @@ func runQuery( strictStores []string, strictEndpoints []string, disableCORS bool, - enableAtModifier bool, - enableNegativeOffset bool, enableQueryPushdown bool, alertQueryURL string, comp component.Component, @@ -480,8 +476,8 @@ func runQuery( NoStepSubqueryIntervalFn: func(int64) int64 { return defaultEvaluationInterval.Milliseconds() }, - EnableNegativeOffset: enableNegativeOffset, - EnableAtModifier: enableAtModifier, + EnableNegativeOffset: true, + EnableAtModifier: true, } ) diff --git a/docs/components/query.md b/docs/components/query.md index 456a0359d0..ee9b29b21a 100644 --- a/docs/components/query.md +++ b/docs/components/query.md @@ -260,7 +260,6 @@ Flags: in all alerts 'Source' field. --enable-feature= ... Comma separated experimental feature names to enable.The current list of features is - promql-negative-offset, promql-at-modifier and query-pushdown. --endpoint= ... Addresses of statically configured Thanos API servers (repeatable). The scheme may be