Skip to content
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

MQE: Add support for delta function #9795

Merged
merged 26 commits into from
Jan 10, 2025
Merged

MQE: Add support for delta function #9795

merged 26 commits into from
Jan 10, 2025

Conversation

lamida
Copy link
Contributor

@lamida lamida commented Nov 1, 2024

What this PR does

Which issue(s) this PR fixes or relates to

Fixes #

Checklist

  • Tests updated.
  • na Documentation added.
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX].
  • na about-versioning.md updated with experimental features.

@lamida lamida marked this pull request as ready for review November 10, 2024 18:28
@lamida lamida requested a review from a team as a code owner November 10, 2024 18:28
@lamida lamida force-pushed the lamida/mqe-delta-function branch 3 times, most recently from b4c6a45 to 840c870 Compare November 13, 2024 08:59
@lamida lamida force-pushed the lamida/mqe-delta-function branch from 840c870 to 0dfa2c1 Compare November 28, 2024 13:20
@chencs
Copy link
Contributor

chencs commented Dec 10, 2024

The CHANGELOG has just been cut to prepare for the next release. Please rebase main and eventually move the CHANGELOG entry added / updated in this PR to the top of the CHANGELOG.md document. Thanks!

Copy link
Contributor

@jhesketh jhesketh left a comment

Choose a reason for hiding this comment

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

I agree with the separation of rate from delta. However, I also think this is how it's done upstream so I'm okay either way.

We should add some more tests to our tests. Specifically around native histograms and mixed data types. eg: what is the delta when the first and last sample are different types. What about having a NH in the middle of a vector of floats etc..

@lamida lamida force-pushed the lamida/mqe-delta-function branch 2 times, most recently from 02a5e6d to daf0654 Compare January 5, 2025 15:11
@lamida lamida mentioned this pull request Jan 6, 2025
4 tasks
@lamida lamida force-pushed the lamida/mqe-delta-function branch from 9d21d80 to a4b03d5 Compare January 9, 2025 16:33
@lamida lamida requested review from jhesketh and charleskorn January 9, 2025 17:45
Signed-off-by: Jon Kartago Lamida <[email protected]>
Signed-off-by: Jon Kartago Lamida <[email protected]>
Signed-off-by: Jon Kartago Lamida <[email protected]>
Signed-off-by: Jon Kartago Lamida <[email protected]>
Signed-off-by: Jon Kartago Lamida <[email protected]>
Signed-off-by: Jon Kartago Lamida <[email protected]>
lamida and others added 7 commits January 10, 2025 11:39
Signed-off-by: Jon Kartago Lamida <[email protected]>
* Extract delta from rate function

Signed-off-by: Jon Kartago Lamida <[email protected]>

* Update pkg/streamingpromql/operators/functions/rate_increase.go

Co-authored-by: Charles Korn <[email protected]>

* Update pkg/streamingpromql/operators/functions/rate_increase.go

Co-authored-by: Charles Korn <[email protected]>

* Update pkg/streamingpromql/operators/functions/rate_increase.go

Co-authored-by: Charles Korn <[email protected]>

* Update pkg/streamingpromql/operators/functions/rate_increase.go

Co-authored-by: Charles Korn <[email protected]>

* Tidy up after applying PR suggestion

Signed-off-by: Jon Kartago Lamida <[email protected]>

* Remove unnecessary head subslice

Signed-off-by: Jon Kartago Lamida <[email protected]>

* Remove wrong placed annotation

Signed-off-by: Jon Kartago Lamida <[email protected]>

* Remove extra copySchema

Signed-off-by: Jon Kartago Lamida <[email protected]>

* Simplify native histogram sub schema

Signed-off-by: Jon Kartago Lamida <[email protected]>

* Remove TODO

Signed-off-by: Jon Kartago Lamida <[email protected]>

* The lastPoint should be last index of the head

Signed-off-by: Jon Kartago Lamida <[email protected]>

* Add delta counterResetHint test

Signed-off-by: Jon Kartago Lamida <[email protected]>

---------

Signed-off-by: Jon Kartago Lamida <[email protected]>
Co-authored-by: Charles Korn <[email protected]>
Signed-off-by: Jon Kartago Lamida <[email protected]>
Signed-off-by: Jon Kartago Lamida <[email protected]>
Signed-off-by: Jon Kartago Lamida <[email protected]>
Signed-off-by: Jon Kartago Lamida <[email protected]>
@lamida lamida force-pushed the lamida/mqe-delta-function branch from 19045f9 to 27fce29 Compare January 10, 2025 03:40
Signed-off-by: Jon Kartago Lamida <[email protected]>
Signed-off-by: Jon Kartago Lamida <[email protected]>
Signed-off-by: Jon Kartago Lamida <[email protected]>
pkg/streamingpromql/engine_test.go Outdated Show resolved Hide resolved
pkg/streamingpromql/engine_test.go Outdated Show resolved Hide resolved
pkg/streamingpromql/engine_test.go Outdated Show resolved Hide resolved
pkg/streamingpromql/engine_test.go Outdated Show resolved Hide resolved
pkg/streamingpromql/engine_test.go Outdated Show resolved Hide resolved
pkg/streamingpromql/engine_test.go Outdated Show resolved Hide resolved
# {path="/bar"} -200
eval instant at 20m delta(http_requests[20m])
{path="/foo"} 200
{path="/bar"} -200

# Unsupported by streaming engine.
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you please enable the new delta-related tests below?

tools/check-for-disabled-but-supported-mqe-test-cases will help identify any test cases that might be able to be enabled.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh missed that. Updated in e72c504

Copy link
Contributor

@charleskorn charleskorn left a comment

Choose a reason for hiding this comment

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

🚀

@lamida lamida enabled auto-merge (squash) January 10, 2025 05:49
@lamida lamida merged commit 6511332 into main Jan 10, 2025
29 checks passed
@lamida lamida deleted the lamida/mqe-delta-function branch January 10, 2025 06:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants