-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
Hi all!
We are using custom controllers to manage our custom resources, and wish to export the workqueue metrics to Prometheus.
This is done by using the workqueue.SetProvider()
provided by kubernetes.io/client-go
.
When we try to register our metrics using this function in our init()
, this doesn't take effect, as the init()
function being used in the metrics
package of this repo seems to making the call to SetProvider()
first.
We can make use of this registry that you provide. It however comes with a whole lot of other metrics which we do not wish to export, such as - leader election, latency, request size, response size and other client metrics. And since they're internal
we aren't able to unregister them.
Wonder if we can either:
- [The best option in my opinion] Create a separate registry for just workqueue metrics in this repo and not add the other metrics to it, so that we can use it in our project. We can then combine all those metrics along with the non-workqueue related ones in a separate registry, thus unaffecting the previous behaviour.
- Not have the
init()
function altogether in themetrics.go
file. Instead provide those functionalities as a separate function, so that we users can call it in ourinit()
. This way, if we choose to, we can create our own metrics and callSetProvider()
ourselves. - Any other option which might not have been covered above...
- Or is there a way we can tackle this on our side without having to make any changes here?
I'm up for working on this issue.