docs: refer to standalone MetricsQL package

This commit is contained in:
Aliaksandr Valialkin 2020-01-02 23:43:29 +02:00
parent 61c9d320ed
commit 0038365206
3 changed files with 5 additions and 2 deletions

View File

@ -2,6 +2,7 @@
VictoriaMetrics implements MetricsQL - query language inspired by [PromQL](https://prometheus.io/docs/prometheus/latest/querying/basics/).
It is backwards compatible with PromQL, so Grafana dashboards backed by Prometheus datasource should work the same after switching from Prometheus to VictoriaMetrics.
[Standalone MetricsQL package](https://godoc.org/github.com/VictoriaMetrics/VictoriaMetrics/lib/metricsql) can be used for parsing MetricsQL in external apps.
The following functionality is implemented differently in MetricsQL comparing to PromQL in order to improve user experience:
* MetricsQL takes into account the previous point before the window in square brackets for range functions such as `rate` and `increase`.

View File

@ -1,6 +1,6 @@
// Package metricsql implements MetricsQL parser.
//
// This parser can parse PromQL. Additionally it can parse MetricsQL extensions.
// This parser can parse PromQL. Additionally it can parse all the MetricsQL extensions.
// See https://github.com/VictoriaMetrics/VictoriaMetrics/wiki/ExtendedPromQL for details about MetricsQL extensions.
//
// Usage:
@ -10,6 +10,6 @@
// // parse error
// }
// // Now expr contains parsed MetricsQL as `*Expr` structs.
// // See metricsql.Parse examples for more details.
// // See Parse examples for more details.
//
package metricsql

View File

@ -9,6 +9,8 @@ import (
// Parse parses MetricsQL query s.
//
// All the `WITH` expressions are expanded in the returned Expr.
//
// MetricsQL is backwards-compatible with PromQL.
func Parse(s string) (Expr, error) {
var p parser