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: fix behaviour of -proxy.compare-skip-recent-samples for long-running queries #9416

Merged
merged 2 commits into from
Sep 26, 2024

Conversation

charleskorn
Copy link
Contributor

@charleskorn charleskorn commented Sep 26, 2024

What this PR does

This PR fixes an issue in the behaviour of the -proxy.compare-skip-recent-samples CLI flag in query-tee.

Previously, when deciding whether to skip a sample, sample timestamps were compared to the time at the time the comparison was occurring. However, for a slow query, this may be well after the query was evaluated, and so may mean that -proxy.compare-skip-recent-samples is ineffective.

This PR changes the behaviour of query-tee to compare sample timestamps to the time at which the query request was sent. This reduces the number of unwanted comparison failures for recent data.

For example, let's say query-tee receives a query at 12:00, the query takes 3 minutes to evaluate through both backends, and -proxy.compare-skip-recent-samples is set to 5 minutes. Let's assume everything else happens instantly, so result comparison happens at 12:03.

With the old behaviour, samples with timestamps after 11:58 will be considered too recent to compare and skipped.

With the new behaviour in this PR, samples with timestamps after 11:55 will be considered too recent to compare and skipped.

Which issue(s) this PR fixes or relates to

(none)

Checklist

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

@charleskorn charleskorn force-pushed the charleskorn/query-tee-slow-queries branch from 62d46a2 to cfa64ce Compare September 26, 2024 03:46
@charleskorn charleskorn marked this pull request as ready for review September 26, 2024 03:58
@charleskorn charleskorn requested a review from a team as a code owner September 26, 2024 03:58
@charleskorn charleskorn enabled auto-merge (squash) September 26, 2024 04:03
@charleskorn charleskorn merged commit 3509c46 into main Sep 26, 2024
29 checks passed
@charleskorn charleskorn deleted the charleskorn/query-tee-slow-queries branch September 26, 2024 04:20
grafanabot pushed a commit that referenced this pull request Sep 27, 2024
…long-running queries (#9416)

* query-tee: fix behaviour of `-proxy.compare-skip-recent-samples` for long-running queries

* Add changelog entry

(cherry picked from commit 3509c46)
narqo pushed a commit that referenced this pull request Sep 27, 2024
…long-running queries (#9416) (#9443)

* query-tee: fix behaviour of `-proxy.compare-skip-recent-samples` for long-running queries

* Add changelog entry

(cherry picked from commit 3509c46)

Co-authored-by: Charles Korn <charleskorn@users.noreply.github.com>
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.

3 participants