From f9db320e5a008230dc8ccf0c604787f38a3a3709 Mon Sep 17 00:00:00 2001 From: Tobias Guggenmos Date: Mon, 24 Feb 2020 13:45:03 +0100 Subject: [PATCH] Look up function call in all cases Signed-off-by: Tobias Guggenmos --- promql/engine.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/promql/engine.go b/promql/engine.go index cde3eb423..de0be4df1 100644 --- a/promql/engine.go +++ b/promql/engine.go @@ -1041,6 +1041,8 @@ func (ev *evaluator) eval(expr parser.Expr) parser.Value { }, e.Param, e.Expr) case *parser.Call: + call := FunctionCalls[e.Func.Name] + if e.Func.Name == "timestamp" { // Matrix evaluation always returns the evaluation time, // so this function needs special handling when given @@ -1048,13 +1050,11 @@ func (ev *evaluator) eval(expr parser.Expr) parser.Value { vs, ok := e.Args[0].(*parser.VectorSelector) if ok { return ev.rangeEval(func(v []parser.Value, enh *EvalNodeHelper) Vector { - return funcTimestamp([]parser.Value{ev.vectorSelector(vs, enh.ts)}, e.Args, enh) + return call([]parser.Value{ev.vectorSelector(vs, enh.ts)}, e.Args, enh) }) } } - call := FunctionCalls[e.Func.Name] - // Check if the function has a matrix argument. var matrixArgIndex int var matrixArg bool