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

Rewrite subqueries that have the same range and resolution #10445

Merged
merged 2 commits into from
Jan 16, 2025

Conversation

56quarters
Copy link
Contributor

@56quarters 56quarters commented Jan 15, 2025

What this PR does

Fix queries that have the same range and resolution since this will only return a single point when using Prometheus 3 selectors, left open and right closed (compared to Prometheus 2 left closed and right closed).

Which issue(s) this PR fixes or relates to

Internal incident

Notes for reviewers

These names were the first things I thought of, please feel free to suggest better ones!

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.

@56quarters 56quarters force-pushed the 56quarters/prom3-fix branch 3 times, most recently from 7019fd3 to 5c1f532 Compare January 15, 2025 20:59
Copy link
Contributor

github-actions bot commented Jan 15, 2025

💻 Deploy preview deleted.

@56quarters 56quarters force-pushed the 56quarters/prom3-fix branch from 5c1f532 to 92e3988 Compare January 15, 2025 21:18
Copy link
Contributor

@chencs chencs left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for doing this!

@56quarters 56quarters requested a review from ywwg January 15, 2025 21:49
Fix queries that have the same range and resolution since this will
only return a single point when using Prometheus 3 selectors, left
open and right closed (compared to Prometheus 2 left closed and right
closed).
Signed-off-by: Nick Pillitteri <nick.pillitteri@grafana.com>
@56quarters 56quarters force-pushed the 56quarters/prom3-fix branch from 44d09d5 to 7c4e255 Compare January 15, 2025 21:50
@56quarters 56quarters marked this pull request as ready for review January 15, 2025 21:57
@56quarters 56quarters requested review from tacole02 and a team as code owners January 15, 2025 21:57
Copy link
Member

@ywwg ywwg left a comment

Choose a reason for hiding this comment

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

lgtm for the rewrites we want to do

@56quarters 56quarters merged commit b812677 into main Jan 16, 2025
31 checks passed
@56quarters 56quarters deleted the 56quarters/prom3-fix branch January 16, 2025 14:12
@grafanabot
Copy link
Contributor

The backport to r325 failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new branch
git switch --create backport-10445-to-r325 origin/r325
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x b812677266850268b4b00dd689a3baedb13a87b2
# Push it to GitHub
git push --set-upstream origin backport-10445-to-r325
git switch main
# Remove the local backport branch
git branch -D backport-10445-to-r325

Then, create a pull request where the base branch is r325 and the compare/head branch is backport-10445-to-r325.

56quarters added a commit that referenced this pull request Jan 16, 2025
* Rewrite subqueries that have the same range and resolution

Fix queries that have the same range and resolution since this will
only return a single point when using Prometheus 3 selectors, left
open and right closed (compared to Prometheus 2 left closed and right
closed).

* Changelog

Signed-off-by: Nick Pillitteri <nick.pillitteri@grafana.com>

---------

Signed-off-by: Nick Pillitteri <nick.pillitteri@grafana.com>
(cherry picked from commit b812677)
56quarters added a commit that referenced this pull request Jan 16, 2025
…10459)

* Rewrite subqueries that have the same range and resolution

Fix queries that have the same range and resolution since this will
only return a single point when using Prometheus 3 selectors, left
open and right closed (compared to Prometheus 2 left closed and right
closed).

* Changelog

Signed-off-by: Nick Pillitteri <nick.pillitteri@grafana.com>

---------

Signed-off-by: Nick Pillitteri <nick.pillitteri@grafana.com>
(cherry picked from commit b812677)
56quarters added a commit that referenced this pull request Jan 16, 2025
From feedback #10459 (comment)

Related #10445

Signed-off-by: Nick Pillitteri <nick.pillitteri@grafana.com>
56quarters added a commit that referenced this pull request Jan 16, 2025
* Rewrite subqueries that have the same range and resolution

Fix queries that have the same range and resolution since this will
only return a single point when using Prometheus 3 selectors, left
open and right closed (compared to Prometheus 2 left closed and right
closed).

* Changelog

Signed-off-by: Nick Pillitteri <nick.pillitteri@grafana.com>

---------

Signed-off-by: Nick Pillitteri <nick.pillitteri@grafana.com>
(cherry picked from commit b812677)
56quarters added a commit that referenced this pull request Jan 16, 2025
…10463)

* Rewrite subqueries that have the same range and resolution

Fix queries that have the same range and resolution since this will
only return a single point when using Prometheus 3 selectors, left
open and right closed (compared to Prometheus 2 left closed and right
closed).

* Changelog

Signed-off-by: Nick Pillitteri <nick.pillitteri@grafana.com>

---------

Signed-off-by: Nick Pillitteri <nick.pillitteri@grafana.com>
(cherry picked from commit b812677)
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.

Two small suggestions:

56quarters added a commit that referenced this pull request Jan 16, 2025
* docs: Fix help text for query-frontend.prom2-range-compat flag

From feedback #10459 (comment)

Related #10445

Signed-off-by: Nick Pillitteri <nick.pillitteri@grafana.com>

* Changelog

Signed-off-by: Nick Pillitteri <nick.pillitteri@grafana.com>

---------

Signed-off-by: Nick Pillitteri <nick.pillitteri@grafana.com>
56quarters added a commit that referenced this pull request Jan 17, 2025
* Rewrite subqueries that have the same range and resolution

Fix queries that have the same range and resolution since this will
only return a single point when using Prometheus 3 selectors, left
open and right closed (compared to Prometheus 2 left closed and right
closed).

* Changelog

Signed-off-by: Nick Pillitteri <nick.pillitteri@grafana.com>

---------

Signed-off-by: Nick Pillitteri <nick.pillitteri@grafana.com>
(cherry picked from commit b812677)
56quarters added a commit that referenced this pull request Jan 17, 2025
…10472)

* Rewrite subqueries that have the same range and resolution

Fix queries that have the same range and resolution since this will
only return a single point when using Prometheus 3 selectors, left
open and right closed (compared to Prometheus 2 left closed and right
closed).

* Changelog

Signed-off-by: Nick Pillitteri <nick.pillitteri@grafana.com>

---------

Signed-off-by: Nick Pillitteri <nick.pillitteri@grafana.com>
(cherry picked from commit b812677)
56quarters added a commit that referenced this pull request Jan 22, 2025
Follow up to #10445, add a metric when queries are rewritten for
compatibility with Prometheus 3 range selector semantics.

Signed-off-by: Nick Pillitteri <nick.pillitteri@grafana.com>
56quarters added a commit that referenced this pull request Jan 22, 2025
Follow up to #10445, add a metric when queries are rewritten for
compatibility with Prometheus 3 range selector semantics.

Signed-off-by: Nick Pillitteri <nick.pillitteri@grafana.com>
56quarters added a commit that referenced this pull request Jan 23, 2025
* Add visibility when subqueries are rewritten

Follow up to #10445, add a metric when queries are rewritten for
compatibility with Prometheus 3 range selector semantics.

Signed-off-by: Nick Pillitteri <nick.pillitteri@grafana.com>

* Skip TestSampleTracker_Concurrency since it is not reliable

Signed-off-by: Nick Pillitteri <nick.pillitteri@grafana.com>

---------

Signed-off-by: Nick Pillitteri <nick.pillitteri@grafana.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.

5 participants