Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/VictoriaMetrics/metricsql

Standalone PromQL and MetricsQL parser
https://github.com/VictoriaMetrics/metricsql

metricsql parser prometheus promql

Last synced: 3 months ago
JSON representation

Standalone PromQL and MetricsQL parser

Awesome Lists containing this project

README

        

[![GoDoc](https://godoc.org/github.com/VictoriaMetrics/metricsql?status.svg)](http://godoc.org/github.com/VictoriaMetrics/metricsql)
[![Go Report](https://goreportcard.com/badge/github.com/VictoriaMetrics/metricsql)](https://goreportcard.com/report/github.com/VictoriaMetrics/metricsql)

# metricsql

Package metricsql implements [MetricsQL](https://docs.victoriametrics.com/metricsql/)
and [PromQL](https://medium.com/@valyala/promql-tutorial-for-beginners-9ab455142085) parser in Go.

### Usage

```go
expr, err := metricsql.Parse(`sum(rate(foo{bar="baz"}[5m])) by (job)`)
if err != nil {
// parse error
}
// Now expr contains parsed MetricsQL as `*Expr` structs.
// See Parse examples for more details.
```

See [docs](https://godoc.org/github.com/VictoriaMetrics/metricsql) for more details.