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

execution,engine: respect configured max samples #302

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

MichaHoffmann
Copy link
Contributor

@MichaHoffmann MichaHoffmann commented Aug 16, 2023

An attempt to start to respect the provided max sample limit from the promql options. It only pipes the sample limits through to matrix and vector selectors.

@MichaHoffmann MichaHoffmann marked this pull request as draft August 16, 2023 15:55
@MichaHoffmann MichaHoffmann force-pushed the mhoffm-add-sample-limits branch 2 times, most recently from 21c457f to 2c86320 Compare August 16, 2023 18:56
@MichaHoffmann MichaHoffmann marked this pull request as ready for review August 16, 2023 18:57
@MichaHoffmann MichaHoffmann force-pushed the mhoffm-add-sample-limits branch 4 times, most recently from dd79a7a to 9bb2f53 Compare August 17, 2023 08:29
engine/engine.go Outdated Show resolved Hide resolved
execution/limits/limits.go Outdated Show resolved Hide resolved
Signed-off-by: Michael Hoffmann <mhoffm@posteo.de>
@MichaHoffmann MichaHoffmann force-pushed the mhoffm-add-sample-limits branch 5 times, most recently from 836a40a to d9fc3c2 Compare August 17, 2023 16:17
"github.com/thanos-io/promql-engine/query"
)

type Limits struct {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this should be an interface and we should have a nop implementation to avoid going through locks when limits are not configured.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed the locks but there is a short circuit if we have no limit at the start anyhow!

@MichaHoffmann MichaHoffmann force-pushed the mhoffm-add-sample-limits branch 8 times, most recently from 3d650aa to bfeae3a Compare August 17, 2023 18:10
@MichaHoffmann MichaHoffmann marked this pull request as draft August 18, 2023 07:08
@MichaHoffmann MichaHoffmann force-pushed the mhoffm-add-sample-limits branch 2 times, most recently from 64226bb to 63f370e Compare August 18, 2023 11:58
@MichaHoffmann MichaHoffmann marked this pull request as ready for review August 18, 2023 11:58
Signed-off-by: Michael Hoffmann <mhoffm@posteo.de>
@MichaHoffmann MichaHoffmann force-pushed the mhoffm-add-sample-limits branch 2 times, most recently from 0aeafa9 to 318b752 Compare August 18, 2023 15:15
Signed-off-by: Michael Hoffmann <mhoffm@posteo.de>
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.

None yet

3 participants