mirror of https://github.com/prometheus/prometheus
Fix timestamp() method for vector selector inside paren (#8164)
Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>pull/8166/head
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,
|
// Matrix evaluation always returns the evaluation time,
|
||||||
// so this function needs special handling when given
|
// so this function needs special handling when given
|
||||||
// a vector selector.
|
// a vector selector.
|
||||||
|
unwrapParenExpr(&e.Args[0])
|
||||||
vs, ok := e.Args[0].(*parser.VectorSelector)
|
vs, ok := e.Args[0].(*parser.VectorSelector)
|
||||||
if ok {
|
if ok {
|
||||||
return ev.rangeEval(func(v []parser.Value, enh *EvalNodeHelper) (Vector, storage.Warnings) {
|
return ev.rangeEval(func(v []parser.Value, enh *EvalNodeHelper) (Vector, storage.Warnings) {
|
||||||
|
|
|
@ -300,6 +300,9 @@ eval instant at 0s timestamp(metric)
|
||||||
eval instant at 5s timestamp(metric)
|
eval instant at 5s timestamp(metric)
|
||||||
{} 0
|
{} 0
|
||||||
|
|
||||||
|
eval instant at 5s timestamp(((metric)))
|
||||||
|
{} 0
|
||||||
|
|
||||||
eval instant at 10s timestamp(metric)
|
eval instant at 10s timestamp(metric)
|
||||||
{} 10
|
{} 10
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue