-
Notifications
You must be signed in to change notification settings - Fork 19
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: add or operator for metric expression #84
feat: add or operator for metric expression #84
Conversation
6d2a28e
to
76bc3d1
Compare
@yuanbohan hi,yuanbohan.if you have time, please help to review it |
May I ask a question: Is this PR the beginning of total implementation of MetricsQL, or only to support |
@yuanbohan just only to support |
BTW, this PR is to support MetricsQL filtering-by-multiple-or-filters |
@groobyming Could you please update the PR description to summarize what the PR does? There is an example: #76 |
OK |
cb6644f
to
1110f9b
Compare
@yuanbohan @evenyag I extended the Matchers structure to support "or filters", if you have time, please help review new commit😀 |
@yuanbohan @evenyag When processing the label4="4" node, if there is no previous processing status, how do you know whether to append to the original {label2="2" or label3="3"}, or to create a new or_matcher and add label1=" 1" and label4="4"? |
In general, there is still a lot of content and state to maintain when adding changes to the matchers structure. like this
|
@yuanbohan @evenyag Add last_filter_action to mark the last append type, if you have time, please help review new commit😀 |
7ffea98
to
67e0e5a
Compare
I guess that we have inconsistent understandings of the "or filter" in MetricsQL. According to the document
I think
The previous matchers group always ends with |
@evenyag Indeed, I misunderstood the usage of OR. I will try to fix this problem later, Thanks 👍 |
@yuanbohan @evenyag Make some changes to fix the problem according to the suggestion 😀 |
or
operator for metric expression
or
operator for metric expressionThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
rebase the main branch to fix the codecov failure please |
46b452a
to
dd2b673
Compare
Done |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Changes have been made to critical files, which contain lines commonly executed in production. Learn more Additional details and impacted files@@ Coverage Diff @@
## main #84 +/- ##
==========================================
+ Coverage 98.96% 98.99% +0.02%
==========================================
Files 14 14
Lines 6098 6272 +174
==========================================
+ Hits 6035 6209 +174
Misses 63 63 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fix the clippy warning
|
@evenyag Hi, evenyag. What version of rustc are we using, my local version is "rustc 1.80.0-nightly" and when running the "cargo Clippy" command no warnings appear. |
You can find the failure detail from the action: https://github.com/GreptimeTeam/promql-parser/actions/runs/9152892165/job/25161349969 , and the command is |
Ok |
fixed |
MetricQL is an enhanced extension of PromQL, And is backward-compatible with PromQL.
Currently, MetricQL already supports using the "or" operator to connect label filters as follows:
For example, the following query selects time series with {job="app1",env="prod"} or {job="app2",env="dev"} labels:
A more detailed description of this feature can be found here MetricsQL filtering-by-multiple-or-filters
This PR is to support filtering by multiple “or” filters