Commit Graph

10 Commits

Author SHA1 Message Date
fpetkovski a6eb25e3c6 rename buildStore to buildStores 2021-06-29 13:30:46 +02:00
fpetkovski 83887f1611 Replace multiListerWatcher with independent listWatchers per namespace
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>
2021-06-29 13:27:57 +02:00
Ahmed Mezghani 257a9431d8
Add WithAllowLabels to BuilderInterface 2021-06-25 16:17:10 +02:00
Lénaïc Huard c22976b826
Fix builder.Builder WithMetrics signature
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>
2021-04-09 14:19:34 +02:00
Quentin Bisson 7250bc2b5c
Update go module path to k8s.io/kube-state-metrics/v2
Signed-off-by: Quentin Bisson <quentin@giantswarm.io>
2020-09-21 10:58:08 +02:00
root 1745b33e8e fix typos 2020-07-31 02:13:18 +00:00
Thibault Le Reste cb655340d6 Rename black-/whitelist to allow/deny-list 2020-02-03 17:05:11 +01:00
cedric lamoriniere 369470d6ea builder.WithGenerateStoreFunc() is now mandatory
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>
2020-01-08 13:45:05 +01:00
cedric lamoriniere ae822f3a2c update code after review
* fix typo
* update copyright date in new files

Signed-off-by: cedric lamoriniere <cedric.lamoriniere@datadoghq.com>
2019-12-17 22:37:23 +01:00
cedric lamoriniere 0a3c7d7fe3 create builder public package
* 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>
2019-12-13 10:50:19 +01:00