diff --git a/docs/user-guide/query-data/promql.md b/docs/user-guide/query-data/promql.md index 820395913..b5bebe67b 100644 --- a/docs/user-guide/query-data/promql.md +++ b/docs/user-guide/query-data/promql.md @@ -129,7 +129,7 @@ Though GreptimeDB supports a rich set of data types, the PromQL implementation i - tag: `String` - value: `Double` -Currently only a subset of PromQL is supported. Here attaches the compatibility list. You can also check our latest compliance report in this [tracking issue](https://github.com/GreptimeTeam/greptimedb/issues/1042). +Currently only a subset (more than 90%) of PromQL is supported. Here attaches the compatibility list. You can also check our latest compliance report in this [tracking issue](https://github.com/GreptimeTeam/greptimedb/issues/1042). ### Literal @@ -137,7 +137,7 @@ Both string and float literals are supported, with the same [rule](https://prome ### Selector -Both instant and range selector are supported. The only exception is the label matching on metric name, e.g.: `{__name__!="request_count}"` (but the equal-matching case is supported: `{__name__="request_count}"`). +Both instant and range selector are supported. But notice that in both Prometheus and GreptimeDB, the label matching on metric name is an exception. Negative matching (e.g. `{__name__!="request_count}"`) is not allowed. Others like equal-matching or regex-matching are supported. Time duration and offset are supported, but `@` modifier is not supported yet. @@ -147,31 +147,29 @@ The timestamp precision in PromQL is limited by its query syntax, only supportin ### Binary -*Pure literal binary-expr like `1+1` is not supported yet.* - - Supported: - | Operator | Example | - | :------- | :------- | - | add | `a + b` | - | sub | `a - b` | - | mul | `a * b` | - | div | `a / b` | - | mod | `a % b` | - | eqlc | `a == b` | - | neq | `a != b` | - | gtr | `a > b` | - | lss | `a < b` | - | gte | `a >= b` | - | lte | `a <= b` | + | Operator | + | :------- | + | add | + | sub | + | mul | + | div | + | mod | + | eqlc | + | neq | + | gtr | + | lss | + | gte | + | lte | + | power | + | atan2 | + | and | + | or | + | unless | - Unsupported: - | Operator | Progress | - | :------- | :------- | - | power | TBD | - | atan2 | TBD | - | and | TBD | - | or | TBD | - | unless | TBD | + +None ### Aggregators @@ -249,3 +247,7 @@ The timestamp precision in PromQL is limited by its query syntax, only supportin | increase | `increase(metric[5m])` | | irate | `irate(metric[5m])` | | reset | `reset(metric[5m])` | + +- Unsupported: + +None \ No newline at end of file diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/query-data/promql.md b/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/query-data/promql.md index 40f00eec1..32b0862f7 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/query-data/promql.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/query-data/promql.md @@ -128,7 +128,7 @@ metric{__field__!~"field_1|field_2"} - tag: `String` - value: `Double` -目前 GreptimeDB 只支持 PromQL 的一个子集,下方附上了兼容性列表。你也可以在[跟踪问题](https://github.com/GreptimeTeam/greptimedb/issues/1042)中查看我们最新的兼容性报告。 +GreptimeDB 目前已实现了大部分(超过 90%)的 PromQL 功能。您可以在下方查看详细的兼容性列表,或者通过此 [issue](https://github.com/GreptimeTeam/greptimedb/issues/1042) 了解我们最新的功能支持情况。 ### 字符(Literal) @@ -136,8 +136,9 @@ metric{__field__!~"field_1|field_2"} ### 选择器 -- 支持即时和范围选择器,但唯独不支持 `label` 和指标名字的不匹配判断,例如 `{__name__!="request_count}"`,等价匹配的情况是支持的,例如 `{__name__="request_count}"`。 -- 支持时间长度和偏移量,但不支持 `@` 修改器。 +Instant 选择器和 Range 选择器均已支持。需要注意的是,在 Prometheus 和 GreptimeDB 中,指标名称的标签匹配有一个特殊限制:不支持反向匹配(例如 `{__name__!="request_count"}`)。但其他匹配方式,如等值匹配和正则匹配都是完全支持的。 + +时间区间和时间偏移修饰符均已支持,但目前尚未支持 `@` 修饰符。 ### 时间精度 @@ -145,31 +146,29 @@ PromQL 的时间戳精度受制于查询语法的限制,最高只支持毫秒 ### Binary -*目前还不支持像 `1+1` 这样纯粹的 binary 表达式。* - - 支持: - | Operator | Example | - | :------- | :------- | - | add | `a + b` | - | sub | `a - b` | - | mul | `a * b` | - | div | `a / b` | - | mod | `a % b` | - | eqlc | `a == b` | - | neq | `a != b` | - | gtr | `a > b` | - | lss | `a < b` | - | gte | `a >= b` | - | lte | `a <= b` | + | Operator | + | :------- | + | add | + | sub | + | mul | + | div | + | mod | + | eqlc | + | neq | + | gtr | + | lss | + | gte | + | lte | + | power | + | atan2 | + | and | + | or | + | unless | - 不支持: - | Operator | Progress | - | :------- | :------- | - | power | TBD | - | atan2 | TBD | - | and | TBD | - | or | TBD | - | unless | TBD | + +无 ### Aggregators @@ -246,4 +245,8 @@ PromQL 的时间戳精度受制于查询语法的限制,最高只支持毫秒 | deriv | `deriv(metric[5m])` | | increase | `increase(metric[5m])` | | irate | `irate(metric[5m])` | - | reset | `reset(metric[5m])` | \ No newline at end of file + | reset | `reset(metric[5m])` | + +- 不支持: + +无 \ No newline at end of file