@@ -347,12 +347,12 @@ func (p *ProxyStorage) NodeReplacer(ctx context.Context, s *parser.EvalStmt, nod
347
347
348
348
// If there is a child that is an aggregator we cannot do anything (as they have their own
349
349
// rules around combining). We'll skip this node and let a lower layer take this on
350
- aggFinder := & BooleanFinder {Func : isAgg }
351
- offsetFinder := & OffsetFinder {}
352
- vecFinder := & BooleanFinder {Func : isVectorSelector }
353
- timestampFinder := & BooleanFinder {Func : hasTimestamp }
350
+ aggFinder := & promclient. BooleanFinder {Func : isAgg }
351
+ offsetFinder := & promclient. OffsetFinder {}
352
+ vecFinder := & promclient. BooleanFinder {Func : isVectorSelector }
353
+ timestampFinder := & promclient. BooleanFinder {Func : hasTimestamp }
354
354
355
- visitor := NewMultiVisitor ([]parser.Visitor {aggFinder , offsetFinder , vecFinder , timestampFinder })
355
+ visitor := promclient . NewMultiVisitor ([]parser.Visitor {aggFinder , offsetFinder , vecFinder , timestampFinder })
356
356
357
357
if _ , err := parser .Walk (ctx , visitor , s , node , nil , nil ); err != nil {
358
358
return nil , err
@@ -395,7 +395,7 @@ func (p *ProxyStorage) NodeReplacer(ctx context.Context, s *parser.EvalStmt, nod
395
395
// that the time be the absolute time, whereas the API returns them based on the
396
396
// range you ask for (with the offset being implicit)
397
397
removeOffsetFn := func () error {
398
- _ , err := parser .Walk (ctx , & OffsetRemover {}, s , node , nil , nil )
398
+ _ , err := parser .Walk (ctx , & promclient. OffsetRemover {}, s , node , nil , nil )
399
399
return err
400
400
}
401
401
@@ -459,19 +459,19 @@ func (p *ProxyStorage) NodeReplacer(ctx context.Context, s *parser.EvalStmt, nod
459
459
460
460
return & parser.AggregateExpr {
461
461
Op : parser .MAX ,
462
- Expr : PreserveLabel (& parser.BinaryExpr {
462
+ Expr : promclient . PreserveLabel (& parser.BinaryExpr {
463
463
Op : parser .DIV ,
464
464
LHS : & parser.AggregateExpr {
465
465
Op : parser .SUM ,
466
- Expr : PreserveLabel (CloneExpr (n .Expr ), model .MetricNameLabel , metricNameWorkaroundLabel ),
466
+ Expr : promclient . PreserveLabel (promclient . CloneExpr (n .Expr ), model .MetricNameLabel , metricNameWorkaroundLabel ),
467
467
Param : n .Param ,
468
468
Grouping : replacedGrouping ,
469
469
Without : n .Without ,
470
470
},
471
471
472
472
RHS : & parser.AggregateExpr {
473
473
Op : parser .COUNT ,
474
- Expr : PreserveLabel (CloneExpr (n .Expr ), model .MetricNameLabel , metricNameWorkaroundLabel ),
474
+ Expr : promclient . PreserveLabel (promclient . CloneExpr (n .Expr ), model .MetricNameLabel , metricNameWorkaroundLabel ),
475
475
Param : n .Param ,
476
476
Grouping : replacedGrouping ,
477
477
Without : n .Without ,
@@ -489,15 +489,15 @@ func (p *ProxyStorage) NodeReplacer(ctx context.Context, s *parser.EvalStmt, nod
489
489
Op : parser .DIV ,
490
490
LHS : & parser.AggregateExpr {
491
491
Op : parser .SUM ,
492
- Expr : CloneExpr (n .Expr ),
492
+ Expr : promclient . CloneExpr (n .Expr ),
493
493
Param : n .Param ,
494
494
Grouping : n .Grouping ,
495
495
Without : n .Without ,
496
496
},
497
497
498
498
RHS : & parser.AggregateExpr {
499
499
Op : parser .COUNT ,
500
- Expr : CloneExpr (n .Expr ),
500
+ Expr : promclient . CloneExpr (n .Expr ),
501
501
Param : n .Param ,
502
502
Grouping : n .Grouping ,
503
503
Without : n .Without ,
@@ -839,11 +839,11 @@ func (p *ProxyStorage) NodeReplacer(ctx context.Context, s *parser.EvalStmt, nod
839
839
// Only valid if the other side is either `NumberLiteral` or `StringLiteral`
840
840
this := n .LHS
841
841
other := n .RHS
842
- literal := ExprIsLiteral (UnwrapExpr (this ))
842
+ literal := promclient . ExprIsLiteral (promclient . UnwrapExpr (this ))
843
843
if ! literal {
844
844
this = n .RHS
845
845
other = n .LHS
846
- literal = ExprIsLiteral (UnwrapExpr (this ))
846
+ literal = promclient . ExprIsLiteral (promclient . UnwrapExpr (this ))
847
847
}
848
848
// If one side is a literal lets check
849
849
if literal {
0 commit comments