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
Alerting: Fix migration to not add label "alertname" #56509
Alerting: Fix migration to not add label "alertname" #56509
Conversation
because it is overridden in state manager anyway
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new branch
git switch --create backport-56509-to-v9.1.x origin/v9.1.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x e2f1201382a2f0ada82677ba243213dce4be6ca8
# Push it to GitHub
git push --set-upstream origin backport-56509-to-v9.1.x
git switch main
# Remove the local backport branch
git branch -D backport-56509-to-v9.1.x Then, create a pull request where the |
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new branch
git switch --create backport-56509-to-v9.2.x origin/v9.2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x e2f1201382a2f0ada82677ba243213dce4be6ca8
# Push it to GitHub
git push --set-upstream origin backport-56509-to-v9.2.x
git switch main
# Remove the local backport branch
git branch -D backport-56509-to-v9.2.x Then, create a pull request where the |
* do not add label alertname because it is overridden in state manager anyway * update state manager to not consider labels with same value as dupe (cherry picked from commit e2f1201) # Conflicts: # pkg/services/ngalert/state/cache.go
* do not add label alertname because it is overridden in state manager anyway * update state manager to not consider labels with same value as dupe (cherry picked from commit e2f1201) # Conflicts: # pkg/services/ngalert/state/cache.go
What this PR does / why we need it:
The migration from legacy to the new Grafana Alerting adds a label
alertname
to the rule. That label gets overridden by the state manager when it calculates the state because the label is reserved. The state manager emits a warning log when there are labels that are overridden. This creates an avalanche of warning logs.This PR updates migration to not add the label (because it is overridden anyway).
Also, it updates state manager logic to compare values of the same label and to emit a warning only if values are different.
Which issue(s) this PR fixes:
Fixes #55670
Special notes for your reviewer: