Commit Graph

23 Commits

Author SHA1 Message Date
Manuel Rüger 0c029b690e chore: Migrate to golangci-lint v2 2025-03-31 14:52:47 +02:00
Manuel Rüger fd2a1f83f3 chore: Build with go 1.22 2024-04-05 00:20:04 +02:00
Manuel Rüger 023f83dd03 Fix: Remove FieldSelector from non-namespaced resources
This should resolve the issue with namespace-denylist as discovered in https://github.com/kubernetes/kube-state-metrics/issues/2187

Regression introduced in c3c552821a

Signed-off-by: Manuel Rüger <manuel@rueg.eu>
2023-09-12 09:34:14 +02:00
Kubernetes Prow Robot 61c9de04cd
Merge pull request #2114 from dgrisonnet/webhook-services
feat: Add webhooks client config service metrics
2023-07-26 03:42:18 -07:00
Manuel Rüger c3c552821a chore: Fix lint
Signed-off-by: Manuel Rüger <manuel@rueg.eu>
2023-07-13 10:35:24 +02:00
Damien Grisonnet 229befd41d *: add webhooks client config service metrics
In order to better identify, prioritize, and debug webhook latency
issues it is important to have a metric that would point to the resource
it is responsible for.  However, it is not possible to have that
dimension in the metrics exposed by Kubernetes because of the unbound
cardinality that such a label would have.

The name of the webhook could be an alternative since it usually
contains some information about the resource that the webhook targets,
however this is not very practical to use in multi-tenants
environments.

A solution for these kind of platform is to tie a specific webhook to a
namespace in order to be able to know which tenant manages it and take
actions depending on that. This is achieveable by leveraging the client
config information of webhooks configured via WebhookConfiguration
resources since Services are namespaced objects.

With these new metrics, users will be able to split the alerting
severity of webhook latency / rejection rate per namespace on top of
being able to do it based on the webhook name. This is key in
environment where administrators don't have control over the webhooks
installed by the various tenants.

Signed-off-by: Damien Grisonnet <dgrisonn@redhat.com>
2023-07-04 18:20:34 +02:00
Catherine Fang 4342ca7b97 Migrate all NewFamilyGenerator to NewFamilyGeneratorWithStability 2023-02-05 22:02:47 -05:00
Sherif Abdel-Naby e205fee343
Extract mergeKeyValue logic into a central function 2022-02-10 04:12:35 +02:00
Sherif Abdel-Naby 3a600f56c7
Optimize Slice Allocations 2022-02-05 18:53:35 +02:00
Min Wang 1b2c05c6c9 Add fieldSelector in listWatchFunc 2021-10-04 18:54:51 -07:00
Lili Cosic 0b76e7d4f4 internal/store: Rework label allow list for label metrics 2020-11-20 15:31:35 +01: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
Yuiko Mori 49197428ce Add DeprecatedVersion to struct FamilyGenerator 2020-08-06 10:31:29 +00:00
Prabhakar Mishra 0ff5482079 update client-go, k/api, k/apimachinery to v1.18.6 and vertical-pod-autoscaler to commit b7922d74509c
use clientgofix library

add context parameter in verticalpodautoscaler

rename PodDisruptionsAllowed to DisruptionsAllowed because of PR 85863 in k8s repo

lint fixes and rename PodDisruptionsAllowed to DisruptionsAllowed in test file

run go mod tidy
2020-07-30 01:54:34 +02:00
qw1mb0 59e0e0cf05 switch mutatingwebhookconfiguration to v1 2020-05-16 20:41:16 +03:00
Lili Cosic 608a1786a5 Merge remote-tracking branch 'upstream/release-1.9' into bring-releases-1.9 2020-02-20 16:27:18 +01:00
Lili Cosic 97678462aa internal/store/validatingwebhookconfiguration.go: Switch to v1
As we are expecting v1 we should also create a watch on v1. Otherwise
see the following error in the logs:

"expected type *v1.ValidatingWebhookConfiguration, but watch
event object had type *v1beta1.ValidatingWebhookConfiguration"
2020-02-13 09:54:39 +01:00
Kubernetes Prow Robot 73d55ba141
Merge pull request #989 from clamoriniere/feature/customBuilder
Add the possibility to provide “custom” metric-store to the builder
2020-01-09 03:47:45 -08:00
Lili Cosic 087c381d5f internal/store/*: Move resource version to value from label
The resource version metrics expose the resource version as a string in the label.
This value can change often and would therefore create huge cardinality.

This changes is to be the number value of the metric itself instead.
2019-12-20 15:55:30 +01:00
cedric lamoriniere 72ad3cb412 Remove FamilyByteSlicer interface
- To allow other external Stores, remove the `FamilyByteSlicer` interface
  and give access directly to `metric.Family`.
- Move functions present in `pkg/metric/generator.go` to a dedicated package
  `generator` in `pkg/metric_generator/generator.go`.

Signed-off-by: cedric lamoriniere <cedric.lamoriniere@datadoghq.com>
2019-12-13 10:50:19 +01:00
Lili Cosic 54cc3c3522 internal/store/*: Move resource version to value from label
The resource version metrics expose the resource version as a string in the label.
This value can change often and would therefore create huge cardinality.

This changes is to be the number value of the metric itself instead.
2019-12-12 09:44:18 +01:00
Ben Wells 816b5b3fec Enable unconvert linter 2019-10-04 21:39:21 +01:00
Nataly Sheinin 99623defbe
add mutatingwebhookconfiguration, validatingwebhookconfiguration metrics 2019-10-03 14:23:18 -04:00