-
Notifications
You must be signed in to change notification settings - Fork 151
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
Custom the save method of the Rule model to handle the annotation "rule" #556
Custom the save method of the Rule model to handle the annotation "rule" #556
Conversation
d1e211e
to
40958ef
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.
I have reviewed and tested your code. It works fine :)
However, I have some minor suggestions I would like you to fix.
Apart from the suggestions I have made here in GitHub, could you please wrap the lines in your commit message at 100 characters?
Thank you very much!
@vincent-olivert-riera |
Looks good to me 👍 Please squash the fixup commits for final review. Don't forget to change the commit message to wrap all lines at 100 characters. |
675e6dd
to
3328fff
Compare
Thank you for your hard work. I squashed the fix-up commits and reformatted the commit message too. 👍 |
When creating or updating a rule on Promgen, the corresponding rule data on Prometheus will be given an annotation rule that is the link to that rule on Promgen. However, the annotation rule on Promgen always has the URI "/rule/0" because it has not been intentionally set up. To ensure data is synced between the two applications, we customize the save method of the Rule model.
3328fff
to
20cb1f1
Compare
When creating or updating a rule on Promgen, the corresponding rule data on Prometheus will be given an annotation "rule" that is the link to that rule on Promgen. However, the annotation rule on Promgen always has the URI "/rule/0" because it has not been intentionally set up:
-->
To ensure data is synced between Promgen and Prometheus, I customize the save method of the Rule model.
This solution will help keep the data in the database synchronized and requires minimal changes while still affecting all processes such as displaying, creating, updating, cloning, or importing rules.
Before:
Data displayed on Rule page after creating or updating rule:
After:
Data displayed on Rule page after creating or updating rule: