promtool: add promql-binop-fill-modifiers to --enable-feature handling (#19153)

Signed-off-by: vishal <httpsvishal07@gmail.com>
This commit is contained in:
Vishal More 2026-07-13 06:27:05 +05:30 committed by GitHub
parent 942dbf9adc
commit 1364c882c6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 5 additions and 1 deletions

View file

@ -364,6 +364,8 @@ func main() {
// This feature is now permanently enabled and therefore a no-op.
case "promql-extended-range-selectors":
promtoolParserOpts.EnableExtendedRangeSelectors = true
case "promql-binop-fill-modifiers":
promtoolParserOpts.EnableBinopFillModifiers = true
case "":
continue
default:

View file

@ -702,7 +702,7 @@ func TestCheckRulesWithFeatureFlag(t *testing.T) {
// As opposed to TestCheckRules calling CheckRules directly we run promtool
// so the feature flag parsing can be tested.
args := []string{"-test.main", "--enable-feature=promql-experimental-functions", "--enable-feature=promql-extended-range-selectors", "check", "rules", "testdata/features.yml"}
args := []string{"-test.main", "--enable-feature=promql-experimental-functions", "--enable-feature=promql-extended-range-selectors", "--enable-feature=promql-binop-fill-modifiers", "check", "rules", "testdata/features.yml"}
tool := exec.Command(promtoolPath, args...)
err := tool.Run()
require.NoError(t, err)

View file

@ -8,3 +8,5 @@ groups:
expr: rate(up[1m * 2])
- record: promql-extended-range-selectors
expr: rate(up[1m] anchored)
- record: promql-binop-fill-modifiers
expr: rate(up[5m]) + fill(0) rate(down[5m])