-
Notifications
You must be signed in to change notification settings - Fork 9.7k
Add step(), min() and max() in promql duration expressions #16777
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
Conversation
6253826
to
ff7572c
Compare
b549206
to
140abe4
Compare
140abe4
to
6b35e78
Compare
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.
Thanks for doing this.
f0d7b27
to
73b2a12
Compare
I have updated the PR with your comments. |
Funnily enough, rate [5m x 5m] was parsed correctly. Fixed by this PR too. |
0eeced5
to
532e386
Compare
a065ef3
to
62d830c
Compare
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.
Looks good, but I wonder if adding min/max was intentional?
If yes, please update PR description as well.
c4bdbb7
to
02cca53
Compare
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.
LGTM, just a couple of more unit test cases 2x2 and you're done I think
02cca53
to
767870d
Compare
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.
LGTM. I'm OK with this, especially since this is experimental and I'm not likely to spot random edge cases.
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.
Just nit-picking left for documentation. Otherwise LGTM.
step() is a new keyword introduced to represent the query step width in duration expressions. min(a,b) and max(a,b) return the min and max from two duration expressions. Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
Signed-off-by: Julien <291750+roidelapluie@users.noreply.github.com>
0e14c9b
to
432f130
Compare
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.
LGTM
Adding a quick summary of what's added here as best I can tell:
|
Yes, it returns the step parameter from the range query. This is deliberate. (You know the step for a sub query anyway as it is set in the very same query.) |
Ref #15862 (comment) where |
No description provided.