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

Fix parser.VectorSelector.String() with empty name matcher #14015

Merged

Conversation

colega
Copy link
Contributor

@colega colega commented Apr 30, 2024

The check fell into "this matcher equals vector selector's name" case when vector selector doesn't have a name and the matcher is an explicit matcher for an empty __name__ label.

To provide some context about why this is important: some downstream projects use the promql.Parse(expr.String()) to clone an expression's AST, and with this bug that matcher disappears in the cloning.

Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com>
Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com>
colega added a commit to grafana/mimir that referenced this pull request Apr 30, 2024
This illustrates the bug from Prometheus:
prometheus/prometheus#14015

Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com>
Copy link
Member

@jesusvazquez jesusvazquez left a comment

Choose a reason for hiding this comment

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

LGTM

@jesusvazquez jesusvazquez merged commit 4b7a44c into prometheus:main May 6, 2024
24 checks passed
colega added a commit to grafana/mimir that referenced this pull request May 7, 2024
This includes the fix from prometheus/prometheus#14015

Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com>
colega added a commit to grafana/mimir that referenced this pull request May 7, 2024
* Update mimir-prometheus to prometheus#14015

This includes the fix from prometheus/prometheus#14015

Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com>

* Update CHANGELOG.md

Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com>

---------

Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com>
colega added a commit to grafana/mimir that referenced this pull request May 8, 2024
This illustrates the bug from Prometheus:
prometheus/prometheus#14015

Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com>
kushalShukla-web pushed a commit to kushalShukla-web/prometheus that referenced this pull request May 13, 2024
…eus#14015)

The check fell into "this matcher equals vector selector's name" case when vector selector doesn't have a name and the matcher is an explicit matcher for an empty __name__ label.

To provide some context about why this is important: some downstream projects use the promql.Parse(expr.String()) to clone an expression's AST, and with this bug that matcher disappears in the cloning.

Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com>
Signed-off-by: kushagra Shukla <kushalshukla110@gmail.com>
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.

None yet

2 participants