Skip to content

[bugfix] Fix incorrect expression parsing in alert setting component #3497

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

Merged
merged 6 commits into from
Jun 24, 2025

Conversation

bigcyy
Copy link
Member

@bigcyy bigcyy commented Jun 23, 2025

What's changed?

#3494
This PR resolves a critical parsing error within the alert settings component. The error occurred when editing an existing threshold rule with contains(__labels__,"xxx"), causing the expression to be displayed incorrectly and making the rule uneditable.

The underlying issue was that the logic for extracting the user-facing expression (user_expr) from the full, raw expression (raw_expr) did not properly filter out internal clauses like contains(__label__,"xxx"). This resulted in a failed visualization of the metric expression.

test:

label_bug_fix.mp4

Checklist

  • I have read the Contributing Guide
  • I have written the necessary doc or comment.
  • I have added the necessary unit tests and all cases have passed.

Add or update API

  • I have added the necessary e2e tests and all cases have passed.

Copy link
Member

@MasamiYui MasamiYui left a comment

Choose a reason for hiding this comment

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

LGTM.

@tomsun28 tomsun28 merged commit e45c31a into apache:master Jun 24, 2025
3 checks passed
lx1229 pushed a commit to lx1229/hertzbeat that referenced this pull request Jun 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

4 participants