From 00383652060a7a6b6c61f09445ecd1bca1e3ed2d Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Thu, 2 Jan 2020 23:43:29 +0200 Subject: [PATCH] docs: refer to standalone MetricsQL package --- docs/ExtendedPromQL.md | 1 + lib/metricsql/doc.go | 4 ++-- lib/metricsql/parser.go | 2 ++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/ExtendedPromQL.md b/docs/ExtendedPromQL.md index 68482703a..be09c368d 100644 --- a/docs/ExtendedPromQL.md +++ b/docs/ExtendedPromQL.md @@ -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`. diff --git a/lib/metricsql/doc.go b/lib/metricsql/doc.go index f0d6df337..e63f42b16 100644 --- a/lib/metricsql/doc.go +++ b/lib/metricsql/doc.go @@ -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 diff --git a/lib/metricsql/parser.go b/lib/metricsql/parser.go index 15b49ff0e..6feb3fe1c 100644 --- a/lib/metricsql/parser.go +++ b/lib/metricsql/parser.go @@ -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