Open
Description
If you try to prettify the query
(1 - (node_memory_MemFree_bytes + node_memory_Cached_bytes + node_memory_Buffers_bytes + node_memory_SReclaimable_bytes) / node_memory_MemTotal_bytes) * 100
You will get the result:
(
1
-
(
(
(
(node_memory_MemFree_bytes + node_memory_Cached_bytes)
+
node_memory_Buffers_bytes
)
+
node_memory_SReclaimable_bytes
)
/
node_memory_MemTotal_bytes
)
)
*
100
It happens because braces are always add if it is BinaryOpExpr
https://github.com/VictoriaMetrics/metricsql/blob/master/parser.go#L1935
and
https://github.com/VictoriaMetrics/metricsql/blob/master/parser.go#L1980