mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-19 09:52:49 +00:00
Merge pull request #114293 from logicalhan/registerer
expose prometheus.Registerer so that we can hook into this from external sources
This commit is contained in:
commit
17bf864c1f
@ -157,6 +157,10 @@ type KubeRegistry interface {
|
||||
Reset()
|
||||
// RegisterMetaMetrics registers metrics about the number of registered metrics.
|
||||
RegisterMetaMetrics()
|
||||
// Registerer exposes the underlying prometheus registerer
|
||||
Registerer() prometheus.Registerer
|
||||
// Gatherer exposes the underlying prometheus gatherer
|
||||
Gatherer() prometheus.Gatherer
|
||||
}
|
||||
|
||||
// kubeRegistry is a wrapper around a prometheus registry-type object. Upon initialization
|
||||
@ -188,6 +192,16 @@ func (kr *kubeRegistry) Register(c Registerable) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Registerer exposes the underlying prometheus.Registerer
|
||||
func (kr *kubeRegistry) Registerer() prometheus.Registerer {
|
||||
return kr.PromRegistry
|
||||
}
|
||||
|
||||
// Gatherer exposes the underlying prometheus.Gatherer
|
||||
func (kr *kubeRegistry) Gatherer() prometheus.Gatherer {
|
||||
return kr.PromRegistry
|
||||
}
|
||||
|
||||
// MustRegister works like Register but registers any number of
|
||||
// Collectors and panics upon the first registration that causes an
|
||||
// error.
|
||||
|
Loading…
Reference in New Issue
Block a user