Native node binding for MetricsQL Parser
make
const metricsql = require('node-metricsql');
const parsed = metricsql.parse(promql);
node example.js 'sum(rate(foo{bar="baz"}[5m])) by (x,y)'
{
"Name":"sum",
"Args":[
{
"Name":"rate",
"Args":[
{
"Expr":{
"LabelFilters":[
{
"IsNegative":false,
"IsRegexp":false,
"Label":"__name__",
"Value":"foo"
},
{
"IsNegative":false,
"IsRegexp":false,
"Label":"bar",
"Value":"baz"
}
]
},
"Window":"5m",
"Offset":"",
"Step":"",
"InheritStep":false
}
]
}
],
"Modifier":{
"Args":[
"x",
"y"
],
"Op":"by"
}
}
- go binding
- function mapping
- format conversion