node-metricsql

1.0.1 • Public • Published

node-metricsql

Native node binding for MetricsQL Parser

Build Module

make

Usage

const metricsql = require('node-metricsql');
const parsed = metricsql.parse(promql);

Test Module

node example.js 'sum(rate(foo{bar="baz"}[5m]))'
{
   "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

/node-metricsql/

    Package Sidebar

    Install

    npm i node-metricsql

    Weekly Downloads

    3

    Version

    1.0.1

    License

    MIT

    Unpacked Size

    3.48 MB

    Total Files

    16

    Last publish

    Collaborators

    • lmangani