diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-08-26 08:15:20 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-08-26 08:15:20 +0000 |
commit | 87d772a7d708fec12f48cd8adc0dedff6e1025da (patch) | |
tree | 1fee344c64cc3f43074a01981e21126c8482a522 /src/go/collectors/go.d.plugin/modules/k8s_state/collect.go | |
parent | Adding upstream version 1.46.3. (diff) | |
download | netdata-upstream.tar.xz netdata-upstream.zip |
Adding upstream version 1.47.0.upstream/1.47.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | src/go/plugin/go.d/modules/k8s_state/collect.go (renamed from src/go/collectors/go.d.plugin/modules/k8s_state/collect.go) | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/go/collectors/go.d.plugin/modules/k8s_state/collect.go b/src/go/plugin/go.d/modules/k8s_state/collect.go index 033d330ce..081a0fdf1 100644 --- a/src/go/collectors/go.d.plugin/modules/k8s_state/collect.go +++ b/src/go/plugin/go.d/modules/k8s_state/collect.go @@ -8,7 +8,7 @@ import ( "strings" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" corev1 "k8s.io/api/core/v1" ) @@ -68,6 +68,13 @@ func (ks *KubeState) collectKubeState(mx map[string]int64) { func (ks *KubeState) collectPodsState(mx map[string]int64) { now := time.Now() for _, ps := range ks.state.pods { + // Skip cronjobs (each of them is a unique container because name contains hash) + // to avoid overwhelming Netdata with high cardinality metrics. + // Related issue https://github.com/netdata/netdata/issues/16412 + if ps.controllerKind == "Job" { + continue + } + if ps.deleted { delete(ks.state.pods, podSource(ps.namespace, ps.name)) ks.removePodCharts(ps) |