mirror of
https://github.com/prometheus/prometheus.git
synced 2025-01-12 06:17:27 -08:00
Look up function call in all cases
Signed-off-by: Tobias Guggenmos <tguggenm@redhat.com>
This commit is contained in:
parent
9ebf6bd1e6
commit
f9db320e5a
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue