diff --git a/promql/engine.go b/promql/engine.go index c21319b41..81bd70d5f 100644 --- a/promql/engine.go +++ b/promql/engine.go @@ -1027,6 +1027,7 @@ func (ev *evaluator) eval(expr parser.Expr) (parser.Value, storage.Warnings) { // Matrix evaluation always returns the evaluation time, // so this function needs special handling when given // a vector selector. + unwrapParenExpr(&e.Args[0]) vs, ok := e.Args[0].(*parser.VectorSelector) if ok { return ev.rangeEval(func(v []parser.Value, enh *EvalNodeHelper) (Vector, storage.Warnings) { diff --git a/promql/testdata/functions.test b/promql/testdata/functions.test index 4703d5309..0279f880d 100644 --- a/promql/testdata/functions.test +++ b/promql/testdata/functions.test @@ -300,6 +300,9 @@ eval instant at 0s timestamp(metric) eval instant at 5s timestamp(metric) {} 0 +eval instant at 5s timestamp(((metric))) + {} 0 + eval instant at 10s timestamp(metric) {} 10