The multiListerWatcher is a composite object encapsulating multiple
ListerWatchers and implements the ListerWatcher interface.
With the current implementation, when an individual lister fails, the
entire List operation fails. This causes no metrics to be shown when KSM
has no permissions to a single namespace.
In addition to this, the multiListerWatcher takes advantage of internal
implementation details if the client-go library by modifiying and
relying on the ResourceVersion metadata field. This introduces a bug
where reconnecting to the API server will break the multiListerWatcher
completely.
This commit replaces the multiListerWatcher with individual
ListerWatchers per each configured namespace, resolving both issues.
Signed-off-by: fpetkovski <filip.petkovsky@gmail.com>
The `WithMetrics` method signature changed from
```
func (b *Builder) WithMetrics(r *prometheus.Registry) {
```
to
```
func (b *Builder) WithMetrics(r prometheus.Registerer) {
```
in #1223 but one occurrence was forgotten.
Signed-off-by: Lénaïc Huard <lenaic.huard@datadoghq.com>
This commit introduces the fact that build.WithGenerateStoreFunc()
needs to be used for configuring properly the `Builder` (like any other
`With...` method.
* rename: `WithCustomGenerateStoreFunc` to `WithGenerateStoreFunc`.
* remove buildStorFunc defaulting in `NewBuilder()` function
* add `DefaultGenerateStoreFunc()` method in `BuilderInterface`
* update `Builder initialisation` in `main.go`
Signed-off-by: cedric lamoriniere <cedric.lamoriniere@datadoghq.com>
* Allow to extend the internal Builder
* All logics still internal
* Add in `metric.Family` the metric family `Type` (counter, gauge)
Signed-off-by: cedric lamoriniere <cedric.lamoriniere@datadoghq.com>