mirror of
https://github.com/prometheus/prometheus.git
synced 2025-03-05 20:59:13 -08:00
Add path to nodereplacer
This commit is contained in:
parent
3dc8c4fc91
commit
ca288e655f
|
@ -331,7 +331,7 @@ func Walk(ctx context.Context, v Visitor, s *EvalStmt, node Node, path []Node, n
|
||||||
}
|
}
|
||||||
|
|
||||||
if nr != nil {
|
if nr != nil {
|
||||||
replacement, err := nr(ctx, s, node)
|
replacement, err := nr(ctx, s, node, path)
|
||||||
if replacement != nil {
|
if replacement != nil {
|
||||||
node = replacement
|
node = replacement
|
||||||
}
|
}
|
||||||
|
@ -569,4 +569,4 @@ func (e *VectorSelector) PositionRange() posrange.PositionRange {
|
||||||
return e.PosRange
|
return e.PosRange
|
||||||
}
|
}
|
||||||
|
|
||||||
type NodeReplacer func(context.Context, *EvalStmt, Node) (Node, error)
|
type NodeReplacer func(context.Context, *EvalStmt, Node, []Node) (Node, error)
|
||||||
|
|
Loading…
Reference in a new issue