Skip to content

Commit 02b2c88

Browse files
committed
add comment retated to early exit in all interfaces metrics collection
1 parent fa40063 commit 02b2c88

File tree

1 file changed

+2
-0
lines changed
  • receiver/kubeletstatsreceiver/internal/kubelet

1 file changed

+2
-0
lines changed

receiver/kubeletstatsreceiver/internal/kubelet/network.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ func addNetworkMetrics(mb *metadata.MetricsBuilder, networkMetrics metadata.Netw
2424
recordInterfaceDataPoint(mb, networkMetrics.IO, &s.Interfaces[i], getInterfaceIO, currentTime)
2525
recordInterfaceDataPoint(mb, networkMetrics.Errors, &s.Interfaces[i], getInterfaceErrors, currentTime)
2626
}
27+
// Because stats.NetworkStats.Interfaces contains metrics for all interfaces, including default,
28+
// we don't need to iterate over stats.NetworkStats.InterfaceStats for it, hence we return here
2729
return
2830
}
2931

0 commit comments

Comments
 (0)