grafana / lezer-logql

LogQL lezer grammar
Apache License 2.0
3 stars 4 forks source link

Nested VectorAggregationExpr returns a broken query. #46

Open gwdawson opened 1 year ago

gwdawson commented 1 year ago

VectorAggregationExpr take a MetricExpr as an argument, when the passed argument is also a VectorAggregationExpr node, the nested part of the query is duplicated.

QUERY:
sum(avg(rate({source="data"}[1m])))

EXPECTED:
sum(
  avg(
    rate(
      {source="data"}
      [1m]
    )
  )
)

ACTUAL:
sum(
  avg(
    rate(
      {source="data"}
      [1m]
    )
  )
)avg(
  rate(
    {source="data"}
    [1m]
  )
)