An open API service indexing awesome lists of open source software.

https://github.com/metrico/node-metricsql

Node Native MetricsQL/PromQL Parser
https://github.com/metrico/node-metricsql

golang metricsql native-module nodejs parser promql

Last synced: 6 months ago
JSON representation

Node Native MetricsQL/PromQL Parser

Awesome Lists containing this project

README

          

# node-metricsql

> Native node binding for [MetricsQL Parser](https://github.com/VictoriaMetrics/metricsql)

### Build Module
```console
make
```

### Usage
```javascript
const metricsql = require('node-metricsql');
const parsed = metricsql.parse(promql);
```

### Test Module
```console
node example.js 'sum(rate(foo{bar="baz"}[5m])) by (x,y)'
```
```json
{
"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"
}
}
```

#### Todo
- [x] go binding
- [x] function mapping
- [x] format conversion