Add step(), min() and max() in promql duration expressions#16777
Add step(), min() and max() in promql duration expressions#16777roidelapluie merged 4 commits intoprometheus:mainfrom
Conversation
6253826 to
ff7572c
Compare
b549206 to
140abe4
Compare
140abe4 to
6b35e78
Compare
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
krajorama
left a comment
There was a problem hiding this comment.
Looks good, but I wonder if adding min/max was intentional?
If yes, please update PR description as well.
c4bdbb7 to
02cca53
Compare
krajorama
left a comment
There was a problem hiding this comment.
LGTM, just a couple of more unit test cases 2x2 and you're done I think
02cca53 to
767870d
Compare
krajorama
left a comment
There was a problem hiding this comment.
LGTM. I'm OK with this, especially since this is experimental and I'm not likely to spot random edge cases.
beorn7
left a comment
There was a problem hiding this comment.
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
|
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.