Add first_over_time and ts_of_first_over_time as experimental functions#17021
Conversation
6233634 to
7052e98
Compare
|
Edit: Cause found, raised #17025 . It's a pre-existing bug in the appender, and not related to this PR or |
7052e98 to
988ef38
Compare
|
I've pushed the additional tests now, with a workaround for #17025 included. |
|
|
c86a1c7 to
d9c40d3
Compare
|
@roidelapluie could you have a look? (I have it on my list, too, but it is a long list, and I would feel better if you checked this anyway.) |
d9c40d3 to
92ea438
Compare
|
The CI test failed with
This strikes me as likely worker load related or unrelated to the PR; certainly I've changed nothing relevant there. Would anybody mind re-running the test and having a look at the PR now I've addressed the comments in it? |
|
@roidelapluie Would you be willing to re-check this PR? |
92ea438 to
194840c
Compare
|
It feels counter intuitive to explicitly mention "including NaN samples" as this is the default for all prometheus functions. |
194840c to
2ed7d1d
Compare
|
@roidelapluie Patched docs to remove the mention of "including NaN samples". No other changes. Thanks for the review, mind re-approving with the change you suggested? Looks like some of the CI is a bit unstable too, as the CI windows test failed again despite no code changes. |
Add a first_over_time function, and corresponding ts_of_first_over_time function. Both are behind the experimental functions feature flag. Signed-off-by: Craig Ringer <[email protected]>
Add further tests for first_over_time (also covering existing last_over_time, count_over_time, etc) to exercise vectors containing a mix of float and histogram samples where the histogram samples do not come last in the series. This tripped over prometheus#17025 so it's structured a bit oddly to work around that bug in the appender as used by promtest. Signed-off-by: Craig Ringer <[email protected]>
2ed7d1d to
30bf18f
Compare
|
@roidelapluie Thanks very much. |
promql: add
first_over_time(...)andts_of_first_over_time(...)functions per #16963Test cover is added for the functions and documentation is updated.
make test-shortpasses; I'll run the longer suite too.The
first_over_time()function is particularly useful when used in a range query asfirst_over_time(m[step()])with--enable-feature=promql-duration-exprto find the first sample within the step range. Usingoffset step()will instead select the newest sample outside the range, if such a sample exists.Which issue(s) does the PR fix:
#16963
Does this PR introduce a user-facing change?