Like Prometheus, but for logs.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
loki/pkg/engine/engine.go

26 lines
737 B

package engine
import "github.com/grafana/loki/v3/pkg/logql/syntax"
// canExecuteWithNewEngine determines whether a query can be executed by the new execution engine.
func canExecuteWithNewEngine(expr syntax.Expr) bool {
switch expr := expr.(type) {
case syntax.SampleExpr:
return false
case syntax.LogSelectorExpr:
ret := true
expr.Walk(func(e syntax.Expr) bool {
switch e.(type) {
case *syntax.LineParserExpr, *syntax.LogfmtParserExpr, *syntax.LogfmtExpressionParserExpr, *syntax.JSONExpressionParserExpr:
ret = false
case *syntax.LineFmtExpr, *syntax.LabelFmtExpr:
ret = false
case *syntax.KeepLabelsExpr, *syntax.DropLabelsExpr:
ret = false
}
return true
})
return ret
}
return false
}