-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Don't set global workqueue MetricsProvider #2238
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
Comments
Closes kubernetes-sigs#2238 Signed-off-by: austin ce <[email protected]>
The Kubernetes project currently lacks enough contributors to adequately respond to all issues. This bot triages un-triaged issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues. This bot triages un-triaged issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle rotten |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. This bot triages issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /close not-planned |
@k8s-triage-robot: Closing this issue, marking it as "Not Planned". In 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/test-infra repository. |
I thought about this issue the other day and one possible approach that came to mind is that rather than using an
|
@sbueringer made me aware that this might break a lot of existing users, because component-base also does this in an init and today controller-runtime happens to "win": https://github.com/kubernetes/component-base/blob/3b0f2cefb281ec6078f2949fe7041619ddcfd262/metrics/prometheus/workqueue/metrics.go#L104 |
Per a bug I was investigating this morning, you may not always win that race. Depending on your import graph, you may end up pulling in component-base earlier than controller-runtime and therefore, it executes the component-base version of this prior to the controller-runtime version, which means we lost. A non-breaking way to do this would be to expose the metrics provider as a public object. I believe users now have access to create their own |
Hmhm. I am wondering if rather than setting the global metric provider for the queues, we could set it only in the opts for the queues we construct if not already set? Then things will keep working for everyone without us having to snatch the global provider. The only case I can think of where that would cause issues is if someone constructs a queue themselves and relies on its metrics shown up in controller-runtime. |
In that case is it not just a case of allowing them to pass the metrics provider in the queue options? |
Yeah but it still would break them by default. But yeah, making the provider public so that can be done is likely good enough. |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. This bot triages issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /close not-planned |
@k8s-triage-robot: Closing this issue, marking it as "Not Planned". In 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. |
Currently, controller-runtime sets the global workqueue MetricsProvider in an init method which makes it impossible for users of the library to configure their own.
As noted in:
The text was updated successfully, but these errors were encountered: