fix: record conflict failures and fix missing status patch metric - #320
fix: record conflict failures and fix missing status patch metric#320rawadhossain wants to merge 2 commits into
Conversation
|
@rawadhossain: The label(s) DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: rawadhossain The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
✅ Deploy Preview for node-readiness-controller ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Hi @rawadhossain. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Tip We noticed you've done this a few times! Consider joining the org to skip this step and gain Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
AvineshTripathi
left a comment
There was a problem hiding this comment.
left my initial thoughts here!
| "ruleResourceVersion", rule.ResourceVersion) | ||
|
|
||
| if err := r.evaluateRuleForNode(ctx, rule, node); err != nil { | ||
| operation := "unknown" |
There was a problem hiding this comment.
can we make a util function here?
| case errors.Is(err, errRemoveTaintFailed): | ||
| operation = "remove_taint" | ||
| } | ||
| log.Error(err, "Failed to evaluate rule for node", |
There was a problem hiding this comment.
I don't think adding operations would add value. We already are logging the error. If the idea here is to standardise error messaging, then that is a whole different discussion.
| case errors.Is(err, errRemoveTaintFailed): | ||
| operation = "remove_taint" | ||
| } | ||
| log.Error(err, "Failed to evaluate node for rule", "rule", rule.Name, "node", node.Name, "operation", operation) |
There was a problem hiding this comment.
same as above. we already log errors.
| log := ctrl.LoggerFrom(ctx) | ||
|
|
||
| var errors []string | ||
| var cleanupErrors []string |
There was a problem hiding this comment.
any particular reason to change this?
|
cc @Priyankasaggu11929 I remember you had some thoughts on this |
Signed-off-by: Rawad Hossain <rawad.hossain00@gmail.com>
9d27a99 to
f04128c
Compare
|
Hi @AvineshTripathi |
|
The largest source of api conflicts (409s) don't rise up because they are handled as merge patch. We should check this after #343 is merged, only after when status conflicts will 'surface' |
Deferred to kubernetes-sigs#320/kubernetes-sigs#288 per review feedback so conflict metrics get handled holistically instead of piecemeal here.
Description
This change improves failure observability by recording conflict-specific failure reasons in
node_readiness_failures_total, fixing a missing failure metric in the node reconciler, and adding logs where API conflicts can actually occur.Previously, conflict exhausted taint operations were recorded as generic taint errors, so it wasn't possible to distinguish them from other patch errors. The rule status patch error path in the node reconciler also logged failures without recording a failure metric.
To fix this:
AddTaintConflictExhaustedRemoveTaintConflictExhaustedStatusPatchConflictExhaustedmonitoring.mdwith the new reason label valuesRelated to Issue #182
Type of Change
/kind feature
Checklist
make testpassesmake lintpasses