Skip to content

Commit

Permalink
Moved Node and Pod resources back to accumulator
Browse files Browse the repository at this point in the history
  • Loading branch information
TylerHelmuth committed May 11, 2022
1 parent f5a90c7 commit 27e9adb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions receiver/kubeletstatsreceiver/internal/kubelet/accumulator.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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) {
Expand Down

0 comments on commit 27e9adb

Please sign in to comment.