feat: Add selector and bootstrap observability metrics#286
Conversation
✅ Deploy Preview for node-readiness-controller canceled.
|
|
[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 |
|
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 Regular contributors should join the org to skip this step. 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. |
406dde6 to
11900ae
Compare
AvineshTripathi
left a comment
There was a problem hiding this comment.
Thanks for the PR! Left a few comments.
|
|
||
| // Update selector_matched_nodes_total from the node list we already fetched. | ||
| var matchedCount int | ||
| for i := range nodeList.Items { |
There was a problem hiding this comment.
we already do the same thing inside processAllNodesForRule here
There was a problem hiding this comment.
Yeah, I intentionally kept it before the dry-run check so the gauge gets updated for both dry-run and normal rules in one place. If I move it into processAllNodesForRule, dryrun rules would never update the metric as they go through processDryRun. Open to refactor it if you think splitting it across both paths is cleaner.
There was a problem hiding this comment.
do you think a cleanup would be better? We could filter nodes before the evaluating them in dryRun or regular run
There was a problem hiding this comment.
yes, that seems cleaner. I'll filter the nodes once in Reconcile(), set the gauge there, and pass the filtered list to both paths. Thanks.
11900ae to
12ab0d9
Compare
|
@AvineshTripathi PTAL. I'll commit the changes once you approve. |
|
@rawadhossain I left one comment PHAL and maybe remove the Bootstrap duration metrics till we merge #224 |
12ab0d9 to
8fcbeca
Compare
8fcbeca to
3051634
Compare
|
@AvineshTripathi I have made the changes. PTAL. |
|
/ok-to-test |
Description
This PR adds three new metrics. Two metrics are fully implemented, while the third is left with TODOs pending discussion.
What each metric does
node_readiness_selector_matched_nodes_totalTracks how many nodes currently match a rule's spec. If a rule's
NodeSelectormatches no nodes, controller performs no work and produces no other signal. This metric makes those misconfigurations immediately visible.node_readiness_bootstrap_completion_errors_totalCounts failures writing the bootstrap completion annotation. If this write fails, the node continues to be re-evaluated even though bootstrap completed. This metric makes those failures visible. This metric surfaces those silent failures with a
ruleandreasonlabel.Related to Issue #182
Type of Change
/kind feature
Testing
Checklist
make testpassesmake lintpasses