2019-12-25 19:35:47 +00:00
|
|
|
// Package metricsql implements MetricsQL parser.
|
|
|
|
//
|
2020-01-02 21:43:29 +00:00
|
|
|
// This parser can parse PromQL. Additionally it can parse all the MetricsQL extensions.
|
2019-12-25 19:35:47 +00:00
|
|
|
// See https://github.com/VictoriaMetrics/VictoriaMetrics/wiki/ExtendedPromQL for details about MetricsQL extensions.
|
|
|
|
//
|
|
|
|
// Usage:
|
|
|
|
//
|
|
|
|
// 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.
|
2020-01-02 21:43:29 +00:00
|
|
|
// // See Parse examples for more details.
|
2019-12-25 19:35:47 +00:00
|
|
|
//
|
|
|
|
package metricsql
|