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
- Host: GitHub
- URL: https://github.com/metrico/node-metricsql
- Owner: metrico
- License: apache-2.0
- Created: 2021-12-05T14:01:44.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-08-06T17:37:36.000Z (about 3 years ago)
- Last Synced: 2025-03-26T12:51:10.820Z (7 months ago)
- Topics: golang, metricsql, native-module, nodejs, parser, promql
- Language: Go
- Homepage:
- Size: 8.82 MB
- Stars: 6
- Watchers: 5
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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