From 27e9adbdf1469d4531d1934fea2b4ac23e6aaef8 Mon Sep 17 00:00:00 2001 From: Tyler Helmuth <12352919+TylerHelmuth@users.noreply.github.com> Date: Thu, 5 May 2022 10:23:17 -0600 Subject: [PATCH] Moved Node and Pod resources back to accumulator --- .../kubeletstatsreceiver/internal/kubelet/accumulator.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/receiver/kubeletstatsreceiver/internal/kubelet/accumulator.go b/receiver/kubeletstatsreceiver/internal/kubelet/accumulator.go index 57b06a741980..3e826ba5e962 100644 --- a/receiver/kubeletstatsreceiver/internal/kubelet/accumulator.go +++ b/receiver/kubeletstatsreceiver/internal/kubelet/accumulator.go @@ -64,7 +64,7 @@ func (a *metricDataAccumulator) nodeStats(s stats.NodeStats) { addNetworkMetrics(a.mb, metadata.NodeNetworkMetrics, s.Network, currentTime) // todo s.Runtime.ImageFs - a.m = append(a.m, a.mb.Emit(getNodeResourceOptions(s)...)) + a.m = append(a.m, a.mb.Emit(metadata.WithK8sNodeName(s.NodeName))) } func (a *metricDataAccumulator) podStats(s stats.PodStats) { @@ -78,7 +78,9 @@ func (a *metricDataAccumulator) podStats(s stats.PodStats) { addFilesystemMetrics(a.mb, metadata.PodFilesystemMetrics, s.EphemeralStorage, currentTime) addNetworkMetrics(a.mb, metadata.PodNetworkMetrics, s.Network, currentTime) - a.m = append(a.m, a.mb.Emit(getPodResourceOptions(s)...)) + a.m = append(a.m, a.mb.Emit(metadata.WithK8sPodUID(s.PodRef.UID), + metadata.WithK8sPodName(s.PodRef.Name), + metadata.WithK8sNamespaceName(s.PodRef.Namespace))) } func (a *metricDataAccumulator) containerStats(sPod stats.PodStats, s stats.ContainerStats) {