Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: update limitation of promql #1490

Merged
merged 2 commits into from
Jan 24, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 26 additions & 24 deletions docs/user-guide/query-data/promql.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,15 +129,15 @@ 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).
waynexia marked this conversation as resolved.
Show resolved Hide resolved

### Literal

Both string and float literals are supported, with the same [rule](https://prometheus.io/docs/prometheus/latest/querying/basics/#literals) as PromQL.

### 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 Othees like equal-matching or regex-matching are supported.
waynexia marked this conversation as resolved.
Show resolved Hide resolved

Time duration and offset are supported, but `@` modifier is not supported yet.

Expand All @@ -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

Expand Down Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -145,31 +145,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

Expand Down Expand Up @@ -246,4 +244,8 @@ PromQL 的时间戳精度受制于查询语法的限制,最高只支持毫秒
| deriv | `deriv(metric[5m])` |
| increase | `increase(metric[5m])` |
| irate | `irate(metric[5m])` |
| reset | `reset(metric[5m])` |
| reset | `reset(metric[5m])` |

- 不支持:

Loading