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

MQE: fix issue where rate or increase can return multiple series with the same labels #9553

Merged
merged 3 commits into from
Oct 8, 2024

Conversation

charleskorn
Copy link
Contributor

@charleskorn charleskorn commented Oct 8, 2024

What this PR does

This PR fixes an issue in MQE's implementation of rate and increase that can cause it to return multiple series with the same labels instead of a single series or returning a vector cannot contain metrics with the same labelset error.

I have a more robust fix planned: moving NeedsSeriesDeduplication to a new SeriesMetadataFunc struct, so that NeedsSeriesDeduplication is always true for DropSeriesName, but I'd like to merge this simpler fix first as it will be far easier to backport.

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 marked this pull request as ready for review October 8, 2024 02:35
@charleskorn charleskorn requested a review from a team as a code owner October 8, 2024 02:35
@charleskorn charleskorn merged commit 25dadff into main Oct 8, 2024
29 checks passed
@charleskorn charleskorn deleted the charleskorn/rate-increase-deduplication branch October 8, 2024 03:07
@grafanabot
Copy link
Contributor

The backport to r309 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-9553-to-r309 origin/r309
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x 25dadff171ce4edc9376c7b536f5fa39dbc2519d
# Push it to GitHub
git push --set-upstream origin backport-9553-to-r309
git switch main
# Remove the local backport branch
git branch -D backport-9553-to-r309

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

@grafanabot
Copy link
Contributor

The backport to r308 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-9553-to-r308 origin/r308
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x 25dadff171ce4edc9376c7b536f5fa39dbc2519d
# Push it to GitHub
git push --set-upstream origin backport-9553-to-r308
git switch main
# Remove the local backport branch
git branch -D backport-9553-to-r308

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

@grafanabot
Copy link
Contributor

The backport to r310 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-9553-to-r310 origin/r310
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x 25dadff171ce4edc9376c7b536f5fa39dbc2519d
# Push it to GitHub
git push --set-upstream origin backport-9553-to-r310
git switch main
# Remove the local backport branch
git branch -D backport-9553-to-r310

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

@grafanabot
Copy link
Contributor

The backport to r311 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-9553-to-r311 origin/r311
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x 25dadff171ce4edc9376c7b536f5fa39dbc2519d
# Push it to GitHub
git push --set-upstream origin backport-9553-to-r311
git switch main
# Remove the local backport branch
git branch -D backport-9553-to-r311

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

charleskorn added a commit that referenced this pull request Oct 8, 2024
…with the same labels (#9553)

* Fix the issue where `rate` or `increase` can return multiple series with the same labels

* Add changelog entry

* Disable unsupported upstream test case

(cherry picked from commit 25dadff)

# Conflicts:
#	CHANGELOG.md
#	pkg/streamingpromql/testdata/ours/functions.test
charleskorn added a commit that referenced this pull request Oct 8, 2024
…with the same labels (#9553)

* Fix the issue where `rate` or `increase` can return multiple series with the same labels

* Add changelog entry

* Disable unsupported upstream test case

(cherry picked from commit 25dadff)

# Conflicts:
#	CHANGELOG.md
#	pkg/streamingpromql/testdata/ours/functions.test
charleskorn added a commit that referenced this pull request Oct 8, 2024
…with the same labels (#9553)

* Fix the issue where `rate` or `increase` can return multiple series with the same labels

* Add changelog entry

* Disable unsupported upstream test case

(cherry picked from commit 25dadff)

# Conflicts:
#	CHANGELOG.md
#	pkg/streamingpromql/functions/rate.go
#	pkg/streamingpromql/testdata/ours/functions.test
charleskorn added a commit that referenced this pull request Oct 8, 2024
…with the same labels (#9553)

* Fix the issue where `rate` or `increase` can return multiple series with the same labels

* Add changelog entry

* Disable unsupported upstream test case

(cherry picked from commit 25dadff)

# Conflicts:
#	CHANGELOG.md
#	pkg/streamingpromql/functions/rate.go
#	pkg/streamingpromql/testdata/ours/functions.test
charleskorn added a commit that referenced this pull request Oct 8, 2024
…with the same labels (#9553) (#9555)

* Fix the issue where `rate` or `increase` can return multiple series with the same labels

* Add changelog entry

* Disable unsupported upstream test case

(cherry picked from commit 25dadff)

# Conflicts:
#	CHANGELOG.md
#	pkg/streamingpromql/testdata/ours/functions.test
charleskorn added a commit that referenced this pull request Oct 8, 2024
…with the same labels (#9553) (#9554)

* Fix the issue where `rate` or `increase` can return multiple series with the same labels

* Add changelog entry

* Disable unsupported upstream test case

(cherry picked from commit 25dadff)

# Conflicts:
#	CHANGELOG.md
#	pkg/streamingpromql/testdata/ours/functions.test
charleskorn added a commit that referenced this pull request Oct 8, 2024
…with the same labels (#9553) (#9557)

* Fix the issue where `rate` or `increase` can return multiple series with the same labels

* Add changelog entry

* Disable unsupported upstream test case

(cherry picked from commit 25dadff)

# Conflicts:
#	CHANGELOG.md
#	pkg/streamingpromql/functions/rate.go
#	pkg/streamingpromql/testdata/ours/functions.test
charleskorn added a commit that referenced this pull request Oct 8, 2024
…with the same labels (#9553) (#9556)

* Fix the issue where `rate` or `increase` can return multiple series with the same labels

* Add changelog entry

* Disable unsupported upstream test case

(cherry picked from commit 25dadff)

# Conflicts:
#	CHANGELOG.md
#	pkg/streamingpromql/functions/rate.go
#	pkg/streamingpromql/testdata/ours/functions.test
@jhesketh jhesketh mentioned this pull request Dec 2, 2024
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