-
Notifications
You must be signed in to change notification settings - Fork 895
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
Fix the issue of missing workqueue metrics in the Karmada controller #5945
base: master
Are you sure you want to change the base?
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
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 #5945 +/- ##
==========================================
+ Coverage 48.15% 48.17% +0.01%
==========================================
Files 664 664
Lines 54803 54798 -5
==========================================
+ Hits 26393 26400 +7
+ Misses 26693 26683 -10
+ Partials 1717 1715 -2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
1. Why miss metricsIn Karmada controller, there are two workqueue metric registration, The simultaneous import of the two packages is not explicitly declared by us, we just want to use They both register workqueue metric in Now, you can check by karmada/vendor/k8s.io/component-base/metrics/prometheus/workqueue/metrics.go Lines 104 to 109 in 471d850
karmada/vendor/sigs.k8s.io/controller-runtime/pkg/metrics/workqueue.go Lines 90 to 100 in 471d850
karmada/vendor/k8s.io/client-go/util/workqueue/metrics.go Lines 262 to 266 in 471d850
karmada/vendor/k8s.io/client-go/util/workqueue/metrics.go Lines 223 to 227 in 471d850
2. When introducedIn ➜ karmada git:(release-1.9) ✗ kh exec -it `kh get pods -n karmada-system | grep $comp | sed -n $i'p' | awk '{print $1}'` -n karmada-system -- sh
/ # curl http://127.0.0.1:8080/metrics | grep workqueue_work_duration_seconds_sum
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0workqueue_work_duration_seconds_sum{name="binding-eviction"} 0
workqueue_work_duration_seconds_sum{name="cluster"} 1.9943413949999997
workqueue_work_duration_seconds_sum{name="cluster-binding-eviction"} 0
workqueue_work_duration_seconds_sum{name="clusterPropagationPolicy reconciler"} 0
workqueue_work_duration_seconds_sum{name="clusterResourceBinding_status_controller"} 0
workqueue_work_duration_seconds_sum{name="clusterresourcebinding"} 0
workqueue_work_duration_seconds_sum{name="cronfederatedhpa"} 0
workqueue_work_duration_seconds_sum{name="dependencies resource detector"} 0
workqueue_work_duration_seconds_sum{name="endpointslice-collect"} 0
workqueue_work_duration_seconds_sum{name="federatedhpa"} 0
workqueue_work_duration_seconds_sum{name="federatedresourcequota"} 0
workqueue_work_duration_seconds_sum{name="hpa-replicas-syncer"} 0
workqueue_work_duration_seconds_sum{name="multiclusterservice"} 0
workqueue_work_duration_seconds_sum{name="namespace"} 0.005409679
100 95079 0 950workqueue_work_duration_seconds_sum{name="propagationPolicy reconciler"} 079
0 0 14.2M 0workqueue_work_duration_seconds_sum{name="remedy-controller"} 0.394528854
--:--:-- --:--:-- --:--workqueue_work_duration_seconds_sum{name="resource detector"} 0.35019135200000034
:-- 15.1M
workqueue_work_duration_seconds_sum{name="resourceBinding_status_controller"} 0
workqueue_work_duration_seconds_sum{name="resourcebinding"} 0
workqueue_work_duration_seconds_sum{name="scale ref worker"} 0
workqueue_work_duration_seconds_sum{name="service-export"} 0
workqueue_work_duration_seconds_sum{name="serviceimport"} 0
workqueue_work_duration_seconds_sum{name="work"} 0.9787631499999999
workqueue_work_duration_seconds_sum{name="work-status"} 0.32815969899999997 From ➜ karmada git:(release-1.10) ✗ kh exec -it `kh get pods -n karmada-system | grep $comp | sed -n $i'p' | awk '{print $1}'` -n karmada-system -- sh
/ # curl http://127.0.0.1:8080/metrics | grep workqueue_work_duration_seconds_sum
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 6474 0 6474 0 0 1794k 0 --:--:-- --:--:-- --:--:-- 2107k 3. Why old version fineIn
But, as
We cannot explicitly specify the import order; the |
7911b9f
to
ed8263a
Compare
Signed-off-by: chaosi-zju <[email protected]>
ed8263a
to
46794dc
Compare
@@ -70,7 +68,7 @@ func NewCustomizedInterpreter(informer genericmanager.SingleClusterInformerManag | |||
} | |||
|
|||
cm.SetAuthenticationInfoResolver(authInfoResolver) | |||
cm.SetServiceResolver(apiserver.NewClusterIPServiceResolver(serviceLister)) | |||
cm.SetServiceResolver(webhookutil.NewDefaultServiceResolver()) |
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.
Actually, before #2999 we used exactly the webhookutil.NewDefaultServiceResolver()
, we need to figure out why changed to apiserver.NewClusterIPServiceResolver(serviceLister)
.
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.
What type of PR is this?
/kind bug
What this PR does / why we need it:
remove the dependency on the
k8s.io/component-base/metrics/prometheus/workqueue
package to fix the issue of missing workqueue metrics in the Karmada controller.Which issue(s) this PR fixes:
Fixes #5696
Special notes for your reviewer:
/ # curl http://127.0.0.1:8080/metrics | grep -v '#' | wc -l 2454
Does this PR introduce a user-facing change?: