-
Notifications
You must be signed in to change notification settings - Fork 256
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
feat: add alert rule options to not send alert on state recovery and to send regardless of state change #5856
Conversation
Thank you @mmdoogie for your contribution. Can you please change your commit messages to semantic format ? For example:
|
c8bac07
to
a512841
Compare
Updated messages as requested. Also synced up the swagger.json with the existing state of alerts/alertNode from the codebase and added the new object parameter. |
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.
Thank you for updating the swagger file to be closer to reality. It still needs some polishing to be approved.
- every new alert must be created with a generated ID
kapacitor/ast_test.go
needs to test the newnoRecoveries
property- UI must be improved
@mmdoogie please let me know if you need help with the changes. |
There's an interaction with the pipeline/tick/AST code in kapacitor -- when a new rule is created and POSTed to chronograf, the kapacitor/alerts.go addAlertNodes uses that functionality to build the alert nodes tickscript. It appears to be parsing the flags correctly up to that point but the build/format process only returns the actual alert nodes and not any of the flag parameters. |
68b5f82
to
592d2d5
Compare
This was a UI issue that you already fixed in d806ba8, and I also modified a test to cover it in 592d2d5 |
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.
Thank you @mmdoogie for addressing my feedback. I rebased your changes on top of the latest master and also tested the new functionality manually to see it in action. It works fine. I also added an extra test to verify that the flags are kept when updating alert nodes.
592d2d5
to
44c8d56
Compare
This was previous requested in #3723 that went stale. I recently had a use case for it and decided to add it.
Added a checkbox to the alert rule builder that's used to determine whether or not to include
noRecoveries
in the TICKscript.I also saw that
stateChangesOnly
was already in the structure so I exposed that in a similar manner.Additionally, the swagger.json didn't look like it matches the current response to the API even before the changes, it was fixed with a new flag added.