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

query-tee: Add an option to skip samples for comparison before a given timestamp #9515

Merged
merged 12 commits into from
Oct 9, 2024

Conversation

codesome
Copy link
Member

@codesome codesome commented Oct 3, 2024

What this PR does

Similar to how we have -proxy.compare-skip-recent-samples, this PR adds -proxy.compare-skip-samples-before to skip samples for comparison that are before the given unix timestamp. It is useful for block builders where you don't want to compare beyond a certain point.

Checklist

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

@codesome codesome requested a review from a team as a code owner October 3, 2024 19:15
Signed-off-by: Ganesh Vernekar <[email protected]>
tools/querytee/proxy.go Outdated Show resolved Hide resolved
tools/querytee/response_comparator.go Outdated Show resolved Hide resolved
@codesome codesome force-pushed the codesome/tee-skip-old branch 2 times, most recently from cb78eb1 to 3e21051 Compare October 5, 2024 21:12
Signed-off-by: Ganesh Vernekar <[email protected]>
@codesome codesome force-pushed the codesome/tee-skip-old branch from 3e21051 to 003c2cf Compare October 5, 2024 21:18
tools/querytee/proxy.go Outdated Show resolved Hide resolved
tools/querytee/response_comparator.go Outdated Show resolved Hide resolved
Signed-off-by: Ganesh Vernekar <[email protected]>
@codesome
Copy link
Member Author

codesome commented Oct 9, 2024

@charleskorn I improved the error message a little bit (unit tests should also reflect that) and also added a comment about it when we filter the samples in the vector.

Signed-off-by: Ganesh Vernekar <[email protected]>
tools/querytee/proxy.go Outdated Show resolved Hide resolved
tools/querytee/response_comparator.go Outdated Show resolved Hide resolved
Signed-off-by: Ganesh Vernekar <[email protected]>
@codesome
Copy link
Member Author

codesome commented Oct 9, 2024

Should be all good now!

Signed-off-by: Ganesh Vernekar <[email protected]>
Copy link
Collaborator

@pracucci pracucci left a comment

Choose a reason for hiding this comment

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

LGTM. I left few minor comments I would be glad if you could take a look at.

I think there a case where comparison will still fail. The compareMatrix() checks len(expected) != len(actual) as first thing. This means that if the number of series is different, it will just fail. However, the number of series may be different just because one of the series has all samples before SkipSamplesBefore and so it's not returned by one of the 2 backends you're comparing.

I don't think it's worth blocking this PR merging (you can already get some value with these changes), but I've the feeling you will have to re-iterate on this.

tools/querytee/response_comparator.go Outdated Show resolved Hide resolved
tools/querytee/response_comparator.go Show resolved Hide resolved
tools/querytee/response_comparator.go Outdated Show resolved Hide resolved
tools/querytee/response_comparator.go Outdated Show resolved Hide resolved
tools/querytee/response_comparator.go Outdated Show resolved Hide resolved
tools/querytee/response_comparator.go Outdated Show resolved Hide resolved
codesome and others added 4 commits October 9, 2024 13:26
@56quarters 56quarters merged commit 539e690 into main Oct 9, 2024
29 checks passed
@56quarters 56quarters deleted the codesome/tee-skip-old branch October 9, 2024 18:05
@codesome
Copy link
Member Author

Follow up of this PR is here #9660

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.

4 participants