-
Notifications
You must be signed in to change notification settings - Fork 11.8k
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: Choose a previous valid AM configuration in case of error #65746
Conversation
Added method to fetch them from the API and its corresponding action and reducer
Due to the latest backend changes, we no longer will provide the option to edit previous AM configurations in a textearea. Instead users will only be allowed to reset to a specific one with the same content. For this reason the textearea for old conf igurations is disabled and a different form action (not submit) is executed on the "reset config" button. The updateAlertManage rConfigAction is reset to its old functionality due to these changes.
0392c4f
to
cba7703
Compare
You have successfully added a new CodeQL configuration |
We'll need it to pass as a parameter to the new reset endpoint
69eb0d0
to
2b8ae89
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Great job! 🎉
public/app/features/alerting/unified/components/admin/AlertmanagerConfigSelector.tsx
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few nits / suggestions.
Code LGTM! 🚀
public/app/features/alerting/unified/components/admin/AlertmanagerConfigSelector.tsx
Outdated
Show resolved
Hide resolved
public/app/features/alerting/unified/components/admin/AlertmanagerConfig.tsx
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
This pull request was removed from the 9.5.0 milestone because 9.5.0 is currently being released. |
What is this feature?
This PR is based on the backend work from #65728 and displays a dropdown with valid AM configurations when the current configuration is invalid so that the user can then choose one from the list to start their Alertmanager.
Why do we need this feature?
Currently if the Alertmanager fails to start, an error message is displayed and the user is basically locked out of Grafana Alerting. A lot of safeguards were added in order to avoid having bad configs saved in the database, but it's impossible to take into account each and every edge case, so this feature works as a sort of "escape hatch".
How will this work?
When there's an invalid configuration, the user is shown an error message and prompted to choose from a list of old, valid configurations
IMPORTANT NOTE: All commits until 1a91808 have been cherry-picked from #59516 which was already approved. The referenced PR was closed because the backend branch it was based off was closed and reimplemented in a new one.
Last 4 commits are new and they address the following changes that are worth to be mentioned:
POST /api/alertmanager/grafana/config/history/<id>/_activate
) has been added for this scenario. When the reset button is clicked it gets called passing the old configuration id.Fixes #54505