Skip to content

Latest commit

 

History

History

parser

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

metricsql

metricsql implements a MetricsQL and PromQL parser in Rust.

Usage

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let query = r#"
        sum(rate(node_cpu_seconds_total{mode="user"}[5m])) by (mode) 
        or 
        sum(rate(node_cpu_seconds_total{mode="system"}[5m])) by (mode)
    "#;
    let expr = metricsql_parser::parse(query)?;
    // Now expr contains parsed MetricsQL as `Expr` enum variants.
    // See parse examples for more details.
}

See docs for more details.