-
Notifications
You must be signed in to change notification settings - Fork 10
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
alerts config basic implementation #15
Conversation
Signed-off-by: nmogulla <Naveen_Mogulla@intuit.com>
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 one question regarding creating alert, if a single alert was created through wavefrontalert controller and not associated with any AlertConfig, what does it mean for our cluster alerts use case? I know we need that logic for namespace alerts use case or other standalone alert use case
for _, config := range alertsConfig.Spec.Alerts { | ||
// Calculate checksum and compare it with the status checksum | ||
exist, reqChecksum := utils.CalculateAlertConfigChecksum(ctx, config) | ||
// if request and status checksum matches then there is change in this specific alert config |
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.
the comment should be there is no change
based on your logic?
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.
Correct. Let me change it
if err := wavefront.ConvertAlertCRToWavefrontRequest(ctx, wfAlert.Spec, &alert); err != nil { | ||
errMsg := "unable to convert the wavefront spec to Alert API request. will not be retried" | ||
log.Error(err, errMsg) | ||
return r.PatchIndividualAlertsConfigError(ctx, &alertsConfig, config.AlertName, err) |
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.
How did you distinguish retry or not retry here? I do not see any difference between line 162 and 154
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.
At this time, we are retrying for every error case- we can probably improved that during testing to see if REQUEUE is not the best option for specific Usecase and update it accordingly
state := alertmanagerv1alpha1.Error | ||
if strings.Contains(err.Error(), "Exceeded limit setting") { | ||
// For ex: error is "Exceeded limit setting: 100 alerts allowed per customer" | ||
state = alertmanagerv1alpha1.Error |
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.
ditto
Signed-off-by: nmogulla <Naveen_Mogulla@intuit.com>
Signed-off-by: nmogulla <Naveen_Mogulla@intuit.com>
Signed-off-by: nmogulla Naveen_Mogulla@intuit.com
close
Could you share the solution in high level?
Could you share the test results?