Skip to content

Conversation

MichaHoffmann
Copy link
Contributor

@MichaHoffmann MichaHoffmann commented Jun 12, 2025

This commit adds the ts_of_(min,max,last)_over_time functions behind the experimental-promql-functions feature flag.

Relates to #8966

Copy link
Member

@beorn7 beorn7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quick first feedback:

After some thinking, my initial hunch has solidified: The names are horrible. While it would be great to have the same name as in ViMe, I don't think I can live with the inconsistent naming here. I like your original idea timestamp_of_max_over_time much more, but it is a bit verbose. Maybe let's do something like ts_of_max_over_time, or max_over_time_ts?

The ViMe names introduce a prefix that is not separated by an underscore. It also doesn't make sense as tmax_over_time sounds like it returns the "time maximum" or "timestamp maximum" of something. But the returned timestamp is not a maximum.

Another general thing: These new functions have to be added to the frontend code, too. Please check other PRs that add new functions to see how that works, e.g. #13059

@MichaHoffmann MichaHoffmann force-pushed the mhoffmann/add-tmin-tmax-tlast-over-time-functions branch from b20867d to cdf4772 Compare June 12, 2025 11:29
@MichaHoffmann MichaHoffmann force-pushed the mhoffmann/add-tmin-tmax-tlast-over-time-functions branch 2 times, most recently from 0528945 to fbcad9f Compare June 12, 2025 11:31
@MichaHoffmann MichaHoffmann requested a review from beorn7 June 12, 2025 11:33
@MichaHoffmann MichaHoffmann force-pushed the mhoffmann/add-tmin-tmax-tlast-over-time-functions branch from fbcad9f to 8533402 Compare June 12, 2025 11:35
Copy link
Member

@saswatamcode saswatamcode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really like this idea, would be super useful for certain peak value over time range queries/dashboard panels!
But yeah, maybe some neater naming :)

Copy link
Member

@beorn7 beorn7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks pretty good. Found one bug with timestamp rounding.

@juliusv could you confirm that you are fine with this and double-check the frontend part? (or @Nexucis of course)

@MichaHoffmann MichaHoffmann force-pushed the mhoffmann/add-tmin-tmax-tlast-over-time-functions branch from 8533402 to ca3cf17 Compare June 12, 2025 13:08
@MichaHoffmann MichaHoffmann requested a review from beorn7 June 12, 2025 13:09
Copy link
Member

@Nexucis Nexucis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changes on UI side looks good to me.

Copy link
Member

@beorn7 beorn7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great stuff.

With @Nexucis UI check and given that this is behind the feature flag, I'll merge it now. If outrage ensues, we can just roll back. It's just an experiment.

@beorn7
Copy link
Member

beorn7 commented Jun 12, 2025

One more thing: @MichaHoffmann could you change the commit description to match the names we have chosen in the end?

@beorn7 beorn7 changed the title promql: add tmin,tmax,tlast_over_time promql: add ts_of_(min|max|last)_over_time Jun 12, 2025
@beorn7
Copy link
Member

beorn7 commented Jun 12, 2025

I have already adjusted the PR title, but commit description is also important.

This commit adds the ts_of_(max,min,last)_over_time functions behind the experimental feature flag.

Signed-off-by: Michael Hoffmann <mhoffmann@cloudflare.com>
@MichaHoffmann MichaHoffmann force-pushed the mhoffmann/add-tmin-tmax-tlast-over-time-functions branch from ca3cf17 to a5fa943 Compare June 12, 2025 15:03
@MichaHoffmann
Copy link
Contributor Author

MichaHoffmann commented Jun 12, 2025

One more thing: @MichaHoffmann could you change the commit description to match the names we have chosen in the end?

done!

Copy link
Member

@bwplotka bwplotka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing, LGTM for the backend code. I can imagine those being super useful for detecting when certain events occurred e.g OOM or CPU spike or lost monitoring 👍

@beorn7 beorn7 merged commit 4aee718 into prometheus:main Jun 12, 2025
44 of 45 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants