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

chore: apply series limit per variant for multi-variant queries #16887

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

Conversation

trevorwhitney
Copy link
Collaborator

What this PR does / why we need it:

Since multi-variant queries will result in many more series than their traditional counterparts, we need to change how we enforce limits on them. This PR changes the series limiter to apply the limit per variant for multi-variant queries.

Checklist

  • Reviewed the CONTRIBUTING.md guide (required)
  • Documentation added
  • Tests updated
  • Title matches the required conventional commits format, see here
    • Note that Promtail is considered to be feature complete, and future development for logs collection will be in Grafana Alloy. As such, feat PRs are unlikely to be accepted unless a case can be made for the feature actually being a bug fix to existing behavior.
  • Changes that require user attention or interaction to upgrade are documented in docs/sources/setup/upgrade/_index.md
  • If the change is deprecating or removing a configuration option, update the deprecated-config.yaml and deleted-config.yaml files respectively in the tools/deprecated-config-checker directory. Example PR

@trevorwhitney trevorwhitney changed the title chore: apply series limit per variant for MV queries chore: apply series limit per variant for multi-variant queries Mar 24, 2025
@trevorwhitney trevorwhitney marked this pull request as ready for review March 25, 2025 23:02
@trevorwhitney trevorwhitney requested a review from a team as a code owner March 25, 2025 23:02
@trevorwhitney trevorwhitney marked this pull request as draft March 27, 2025 23:07
@trevorwhitney
Copy link
Collaborator Author

trevorwhitney commented Mar 27, 2025

Converted to the a draft. After talking with the frontend folks, I realized the importance of returning the variants that aren't over the limit while throwing away the ones that are. I'm refactoring to incorporate that into this PR.

It's ready again 🚀

@trevorwhitney trevorwhitney marked this pull request as ready for review March 27, 2025 23:23
var hash uint64
newResult := make([]queryrangebase.SampleStream, 0, len(promResponse.Response.Data.Result))
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don't like this, it's going to double the memory needed. I'm going to change this on Tuesday to reuse the slice in the response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant