mirror of
https://github.com/prometheus/prometheus.git
synced 2024-12-25 05:34:05 -08:00
Fix timestamp() method for vector selector inside paren (#8164)
Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>
This commit is contained in:
parent
f8ba0ed906
commit
d30da66d77
|
@ -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) {
|
||||
|
|
3
promql/testdata/functions.test
vendored
3
promql/testdata/functions.test
vendored
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue