From 9de65707ca441803697a283ff47c1f366f582a3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Rop=C3=A9?= Date: Wed, 14 Feb 2024 12:47:50 +0100 Subject: [PATCH] runtime: stop reporting net dev metrics for the shim MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As part of the shim network metrics, the shim is reporting network interfaces from the host with no namespace isolation - this gives insight in interfaces not tied to the kata containers, and causes an increase in resource usage for kata metrics. As the shim itself is not using the network (all its communication with other processes is done with local unix sockets), there is no reason to keep gathering and reporting shim-specific network metrics. Actual network usage of the kata containers can be found from the existing hypervisor network metrics (kata_hypervisor_netdev) and from the agent network metrics (kata_guest_netdev_stat). Fixes: #5738 Signed-off-by: Julien Ropé --- .../pkg/containerd-shim-v2/shim_metrics.go | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/src/runtime/pkg/containerd-shim-v2/shim_metrics.go b/src/runtime/pkg/containerd-shim-v2/shim_metrics.go index d946665e18..3c3f21ec2a 100644 --- a/src/runtime/pkg/containerd-shim-v2/shim_metrics.go +++ b/src/runtime/pkg/containerd-shim-v2/shim_metrics.go @@ -49,14 +49,6 @@ var ( []string{"item"}, ) - katashimNetdev = prometheus.NewGaugeVec(prometheus.GaugeOpts{ - Namespace: namespaceKatashim, - Name: "netdev", - Help: "Kata containerd shim v2 network devices statistics.", - }, - []string{"interface", "item"}, - ) - katashimIOStat = prometheus.NewGaugeVec(prometheus.GaugeOpts{ Namespace: namespaceKatashim, Name: "io_stat", @@ -89,7 +81,6 @@ func registerMetrics() { prometheus.MustRegister(katashimThreads) prometheus.MustRegister(katashimProcStatus) prometheus.MustRegister(katashimProcStat) - prometheus.MustRegister(katashimNetdev) prometheus.MustRegister(katashimIOStat) prometheus.MustRegister(katashimOpenFDs) prometheus.MustRegister(katashimPodOverheadCPU) @@ -108,14 +99,6 @@ func updateShimMetrics() error { katashimOpenFDs.Set(float64(fds)) } - // network device metrics - if netdev, err := proc.NetDev(); err == nil { - // netdev: map[string]NetDevLine - for _, v := range netdev { - mutils.SetGaugeVecNetDev(katashimNetdev, v) - } - } - // proc stat if procStat, err := proc.Stat(); err == nil { katashimThreads.Set(float64(procStat.NumThreads))