-
Notifications
You must be signed in to change notification settings - Fork 919
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
Ensure controller names are unique when emitting metrics #5799
Conversation
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.
Generally looks good.
I'm currently trying to bump Kubernetes dependencies (#5796). I will test this commit to ensure all controllers have a unique name.
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #5799 +/- ##
==========================================
+ Coverage 42.88% 42.99% +0.11%
==========================================
Files 656 656
Lines 55888 55921 +33
==========================================
+ Hits 23968 24044 +76
+ Misses 30369 30333 -36
+ Partials 1551 1544 -7
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
/retitle Ensure controller names are unique when emitting metrics |
/assign |
Signed-off-by: chaosi-zju <[email protected]>
bd4da2e
to
b605d9d
Compare
Background and Test result
// ResourceBindingController
controllerruntime.NewControllerManagedBy(mgr).
For(&workv1alpha2.ResourceBinding{}).
...
Complete(c)
// RBStatusController
controllerruntime.NewControllerManagedBy(mgr).
For(&workv1alpha2.ResourceBinding{}, bindingPredicateFn).
...
Complete(c) they all reconcile controller_runtime_active_workers{controller="resourcebinding"} 0
controller_runtime_max_concurrent_reconciles{controller="resourcebinding"} 5
controller_runtime_reconcile_errors_total{controller="resourcebinding"} 72
controller_runtime_reconcile_total{controller="resourcebinding",result="error"} 72
controller_runtime_reconcile_total{controller="resourcebinding",result="requeue"} 0
controller_runtime_reconcile_total{controller="resourcebinding",result="requeue_after"} 0
controller_runtime_reconcile_total{controller="resourcebinding",result="success"} 278 so this PR set a unique name to each controller, then their metics can be distinguished as the following: controller_runtime_active_workers{controller="binding-controller"} 0
controller_runtime_max_concurrent_reconciles{controller="binding-controller"} 5
controller_runtime_reconcile_errors_total{controller="binding-controller"} 0
controller_runtime_reconcile_total{controller="binding-controller",result="error"} 0
controller_runtime_reconcile_total{controller="binding-controller",result="requeue"} 0
controller_runtime_reconcile_total{controller="binding-controller",result="requeue_after"} 0
controller_runtime_reconcile_total{controller="binding-controller",result="success"} 0
controller_runtime_active_workers{controller="resource-binding-status-controller"} 0
controller_runtime_max_concurrent_reconciles{controller="resource-binding-status-controller"} 5
controller_runtime_reconcile_errors_total{controller="resource-binding-status-controller"} 0
controller_runtime_reconcile_total{controller="resource-binding-status-controller",result="error"} 0
controller_runtime_reconcile_total{controller="resource-binding-status-controller",result="requeue"} 0
controller_runtime_reconcile_total{controller="resource-binding-status-controller",result="requeue_after"} 0
controller_runtime_reconcile_total{controller="resource-binding-status-controller",result="success"} 0 |
/retest
|
/lgtm Hold for a while as I'm testing it on my private branch which bumps controller-runtime. |
/approve I verified on my side with [email protected] which validates controller names to be unique. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: RainbowMango The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Is there any relevant log that can show us what it would look like if the validation fails ? |
The
|
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
set fixed names for each controller to prevent metrics conflicts
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
The controller-runtime will validate controller names starting v0.19.x.
See kubernetes-sigs/controller-runtime#2902 for reference.
Does this PR introduce a user-facing change?: