Repository: DataDog/datadog-agent
Pull request #35499: [ebpf] refactored util/kernel/netns pkg from util/kernel
Author: login: val06
Labels: name: changelog/no-changelog
description: No changelog entry needed
name: component/system-probe
name: team/ebpf-platform
name: qa/done
description: QA done before merge and regressions are covered by tests
name: long review
description: PR is complex, plan time to review it
name: ask-review
description: Ask required teams to review this PR
Created: 2025-03-26T09:33:40Z | Merged: 2025-03-26T18:35:08Z

### What does this PR do?

refactored network namespace logic into a separate sub-package

### Motivation

reduce the size of a large util package. netns is using a 3rd party pkg, that we don't want to import if not needed

### Describe how you validated your changes
existing tests and linters should pass

### Possible Drawbacks / Trade-offs

### Additional Notes
This PR doesn't make implementation code changes, but rather moves files between packages and updates the imports


Diff:
diff --git a/pkg/collector/corechecks/servicediscovery/module/impl_linux.go b/pkg/collector/corechecks/servicediscovery/module/impl_linux.go
index 1a25e09627b8..892219fa2088 100644
--- a/pkg/collector/corechecks/servicediscovery/module/impl_linux.go
+++ b/pkg/collector/corechecks/servicediscovery/module/impl_linux.go
@@ -37,6 +37,7 @@ import (
 	"github.com/DataDog/datadog-agent/pkg/process/procutil"
 	proccontainers "github.com/DataDog/datadog-agent/pkg/process/util/containers"
 	"github.com/DataDog/datadog-agent/pkg/util/kernel"
+	"github.com/DataDog/datadog-agent/pkg/util/kernel/netns"
 	"github.com/DataDog/datadog-agent/pkg/util/log"
 )
 
@@ -614,7 +615,7 @@ func (s *discovery) getService(context parsingContext, pid int32) *model.Service
 		return nil
 	}
 
-	ns, err := kernel.GetNetNsInoFromPid(context.procRoot, int(pid))
+	ns, err := netns.GetNetNsInoFromPid(context.procRoot, int(pid))
 	if err != nil {
 		return nil
 	}
diff --git a/pkg/network/config/netns_linux.go b/pkg/network/config/netns_linux.go
index 36ccc2fafb91..199ab27b0207 100644
--- a/pkg/network/config/netns_linux.go
+++ b/pkg/network/config/netns_linux.go
@@ -10,7 +10,7 @@ import (
 
 	"github.com/vishvananda/netns"
 
-	"github.com/DataDog/datadog-agent/pkg/util/kernel"
+	netnsutil "github.com/DataDog/datadog-agent/pkg/util/kernel/netns"
 )
 
 // GetRootNetNs returns the network namespace to use for creating, e.g., netlink sockets
@@ -24,5 +24,5 @@ func (c *Config) GetRootNetNs() (netns.NsHandle, error) {
 	}
 
 	// get the root network namespace
-	return kernel.GetRootNetNamespace(c.ProcRoot)
+	return netnsutil.GetRootNetNamespace(c.ProcRoot)
 }
diff --git a/pkg/network/dns/monitor_linux.go b/pkg/network/dns/monitor_linux.go
index bd8c606415f0..6b31d1a3c9ef 100644
--- a/pkg/network/dns/monitor_linux.go
+++ b/pkg/network/dns/monitor_linux.go
@@ -20,6 +20,7 @@ import (
 	"github.com/DataDog/datadog-agent/pkg/network/ebpf/probes"
 	"github.com/DataDog/datadog-agent/pkg/network/filter"
 	"github.com/DataDog/datadog-agent/pkg/util/kernel"
+	netnsutil "github.com/DataDog/datadog-agent/pkg/util/kernel/netns"
 	"github.com/DataDog/datadog-agent/pkg/util/log"
 )
 
@@ -42,7 +43,7 @@ func NewReverseDNS(cfg *config.Config, _ telemetry.Component) (ReverseDNS, error
 	}
 	defer ns.Close()
 
-	err = kernel.WithNS(ns, func() error {
+	err = netnsutil.WithNS(ns, func() error {
 		packetSrc, srcErr = filter.NewAFPacketSource(4 << 20) // 4 MB total
 		return srcErr
 	})
diff --git a/pkg/network/filter/socket_filter.go b/pkg/network/filter/socket_filter.go
index 5c29b2d15cea..ec8dcfa19496 100644
--- a/pkg/network/filter/socket_filter.go
+++ b/pkg/network/filter/socket_filter.go
@@ -16,7 +16,7 @@ import (
 	"golang.org/x/sys/unix"
 
 	"github.com/DataDog/datadog-agent/pkg/network/config"
-	"github.com/DataDog/datadog-agent/pkg/util/kernel"
+	netnsutil "github.com/DataDog/datadog-agent/pkg/util/kernel/netns"
 )
 
 type headlessSocketFilter struct {
@@ -44,7 +44,7 @@ func HeadlessSocketFilter(cfg *config.Config, filter *manager.Probe) (closeFn fu
 	}
 	defer ns.Close()
 
-	err = kernel.WithNS(ns, func() error {
+	err = netnsutil.WithNS(ns, func() error {
 		hsf.fd, err = unix.Socket(unix.AF_PACKET, unix.SOCK_RAW, int(htons(unix.ETH_P_ALL)))
 		if err != nil {
 			return err
diff --git a/pkg/network/gateway_lookup_linux.go b/pkg/network/gateway_lookup_linux.go
index 9236bcd6bb8a..d2a6e5bbc714 100644
--- a/pkg/network/gateway_lookup_linux.go
+++ b/pkg/network/gateway_lookup_linux.go
@@ -23,7 +23,7 @@ import (
 	"github.com/DataDog/datadog-agent/pkg/process/util"
 	"github.com/DataDog/datadog-agent/pkg/telemetry"
 	"github.com/DataDog/datadog-agent/pkg/util/ec2"
-	"github.com/DataDog/datadog-agent/pkg/util/kernel"
+	netnsutil "github.com/DataDog/datadog-agent/pkg/util/kernel/netns"
 	"github.com/DataDog/datadog-agent/pkg/util/log"
 )
 
@@ -142,7 +142,7 @@ func (g *gatewayLookup) LookupWithIPs(source util.Address, dest util.Address, ne
 
 		var s Subnet
 		var err error
-		err = kernel.WithNS(g.rootNetNs, func() error {
+		err = netnsutil.WithNS(g.rootNetNs, func() error {
 			var ifi *net.Interface
 			ifi, err = net.InterfaceByIndex(r.IfIndex)
 			if err != nil {
diff --git a/pkg/network/netlink/conntrack_integration_test.go b/pkg/network/netlink/conntrack_integration_test.go
index 46049481e994..059147bcbb52 100644
--- a/pkg/network/netlink/conntrack_integration_test.go
+++ b/pkg/network/netlink/conntrack_integration_test.go
@@ -21,7 +21,7 @@ import (
 
 	"github.com/DataDog/datadog-agent/pkg/network/netlink/testutil"
 	nettestutil "github.com/DataDog/datadog-agent/pkg/network/testutil"
-	"github.com/DataDog/datadog-agent/pkg/util/kernel"
+	netnsutil "github.com/DataDog/datadog-agent/pkg/util/kernel/netns"
 	"github.com/DataDog/datadog-agent/pkg/util/log"
 )
 
@@ -90,7 +90,7 @@ func BenchmarkConntrackExists(b *testing.B) {
 	tcpAddr := tcpConn.LocalAddr().(*net.TCPAddr)
 	laddrIP := tcpAddr.IP.String()
 	laddrPort := tcpAddr.Port
-	rootNs, err := kernel.GetRootNetNamespace("/proc")
+	rootNs, err := netnsutil.GetRootNetNamespace("/proc")
 	require.NoError(b, err)
 	defer rootNs.Close()
 
@@ -212,7 +212,7 @@ func TestConntrackExistsRootDNAT(t *testing.T) {
 	require.NoError(t, err)
 	defer testNs.Close()
 
-	rootNs, err := kernel.GetRootNetNamespace("/proc")
+	rootNs, err := netnsutil.GetRootNetNamespace("/proc")
 	require.NoError(t, err)
 	defer rootNs.Close()
 
@@ -243,7 +243,7 @@ func TestConntrackExistsRootDNAT(t *testing.T) {
 }
 
 func testConntrackExists(t *testing.T, laddrIP string, laddrPort int, proto string, testNs netns.NsHandle, ctrks map[netns.NsHandle]Conntrack) {
-	rootNs, err := kernel.GetRootNetNamespace("/proc")
+	rootNs, err := netnsutil.GetRootNetNamespace("/proc")
 	require.NoError(t, err)
 	defer rootNs.Close()
 
@@ -326,7 +326,7 @@ func testConntrackExists(t *testing.T, laddrIP string, laddrPort int, proto stri
 }
 
 func testConntrackExists6(t *testing.T, laddrIP string, laddrPort int, proto string, testNs netns.NsHandle, ctrks map[netns.NsHandle]Conntrack) {
-	rootNs, err := kernel.GetRootNetNamespace("/proc")
+	rootNs, err := netnsutil.GetRootNetNamespace("/proc")
 	require.NoError(t, err)
 	defer rootNs.Close()
 
diff --git a/pkg/network/netlink/conntracker_integration_test.go b/pkg/network/netlink/conntracker_integration_test.go
index 6aa15bb7556f..bcb6d8f29252 100644
--- a/pkg/network/netlink/conntracker_integration_test.go
+++ b/pkg/network/netlink/conntracker_integration_test.go
@@ -26,7 +26,7 @@ import (
 	"github.com/DataDog/datadog-agent/pkg/network/netlink/testutil"
 	nettestutil "github.com/DataDog/datadog-agent/pkg/network/testutil"
 	"github.com/DataDog/datadog-agent/pkg/process/util"
-	"github.com/DataDog/datadog-agent/pkg/util/kernel"
+	netnsutil "github.com/DataDog/datadog-agent/pkg/util/kernel/netns"
 )
 
 const (
@@ -54,7 +54,7 @@ func TestConnTrackerCrossNamespaceAllNsDisabled(t *testing.T) {
 	require.NoError(t, err)
 	defer testNs.Close()
 
-	testIno, err := kernel.GetInoForNs(testNs)
+	testIno, err := netnsutil.GetInoForNs(testNs)
 	require.NoError(t, err)
 
 	time.Sleep(time.Second)
diff --git a/pkg/network/netlink/consumer.go b/pkg/network/netlink/consumer.go
index 942c0b1e7b77..757a4a52ca01 100644
--- a/pkg/network/netlink/consumer.go
+++ b/pkg/network/netlink/consumer.go
@@ -23,6 +23,7 @@ import (
 	"github.com/DataDog/datadog-agent/pkg/network/config"
 	"github.com/DataDog/datadog-agent/pkg/telemetry"
 	"github.com/DataDog/datadog-agent/pkg/util/kernel"
+	netnsutil "github.com/DataDog/datadog-agent/pkg/util/kernel/netns"
 	"github.com/DataDog/datadog-agent/pkg/util/log"
 	ddsync "github.com/DataDog/datadog-agent/pkg/util/sync"
 )
@@ -238,14 +239,14 @@ func (c *Consumer) DumpTable(family uint8) (<-chan Event, error) {
 	var nss []netns.NsHandle
 	var err error
 	if c.listenAllNamespaces {
-		nss, err = kernel.GetNetNamespaces(c.procRoot)
+		nss, err = netnsutil.GetNetNamespaces(c.procRoot)
 		if err != nil {
 			return nil, fmt.Errorf("error dumping conntrack table, could not get network namespaces: %w", err)
 		}
 	}
 
 	var conn *netlink.Conn
-	err = kernel.WithNS(c.rootNetNs, func() error {
+	err = netnsutil.WithNS(c.rootNetNs, func() error {
 		conn, err = netlink.Dial(unix.AF_UNSPEC, &netlink.Config{})
 		return err
 	})
@@ -293,7 +294,7 @@ func (c *Consumer) DumpTable(family uint8) (<-chan Event, error) {
 }
 
 func (c *Consumer) dumpTable(family uint8, output chan Event, ns netns.NsHandle) error {
-	return kernel.WithNS(ns, func() error {
+	return netnsutil.WithNS(ns, func() error {
 
 		log.Tracef("dumping table for ns %s family %d", ns, family)
 
@@ -326,7 +327,7 @@ func (c *Consumer) dumpTable(family uint8, output chan Event, ns netns.NsHandle)
 			return fmt.Errorf("netlink dump message validation error: %w", err)
 		}
 
-		nsIno, err := kernel.GetInoForNs(ns)
+		nsIno, err := netnsutil.GetInoForNs(ns)
 		if err != nil {
 			return fmt.Errorf("netns ino: %w", err)
 		}
@@ -349,7 +350,7 @@ func LoadNfConntrackKernelModule(cfg *config.Config) error {
 
 	sock, err := NewSocket(ns)
 	if err != nil {
-		ino, errIno := kernel.GetInoForNs(ns)
+		ino, errIno := netnsutil.GetInoForNs(ns)
 		if errIno != nil {
 			return fmt.Errorf("failed to create new socket for net ns %d and failed to get inode: %v,  %w", int(ns), errIno, err)
 		}
@@ -391,7 +392,7 @@ func (c *Consumer) DumpAndDiscardTable(family uint8) (<-chan bool, error) {
 	var nss []netns.NsHandle
 	var err error
 	if c.listenAllNamespaces {
-		nss, err = kernel.GetNetNamespaces(c.procRoot)
+		nss, err = netnsutil.GetNetNamespaces(c.procRoot)
 		if err != nil {
 			return nil, fmt.Errorf("error dumping conntrack table, could not get network namespaces: %w", err)
 		}
@@ -439,7 +440,7 @@ func (c *Consumer) DumpAndDiscardTable(family uint8) (<-chan bool, error) {
 }
 
 func (c *Consumer) dumpAndDiscardTable(family uint8, ns netns.NsHandle) error {
-	return kernel.WithNS(ns, func() error {
+	return netnsutil.WithNS(ns, func() error {
 
 		log.Tracef("dumping table for ns %s family %d", ns, family)
 
diff --git a/pkg/network/netlink/socket.go b/pkg/network/netlink/socket.go
index d05ce1c98aea..6c30f4efb8e3 100644
--- a/pkg/network/netlink/socket.go
+++ b/pkg/network/netlink/socket.go
@@ -14,14 +14,13 @@ import (
 	"syscall"
 	"unsafe"
 
-	"go.uber.org/atomic"
-
 	"github.com/mdlayher/netlink"
 	"github.com/vishvananda/netns"
+	"go.uber.org/atomic"
 	"golang.org/x/net/bpf"
 	"golang.org/x/sys/unix"
 
-	"github.com/DataDog/datadog-agent/pkg/util/kernel"
+	netnsutil "github.com/DataDog/datadog-agent/pkg/util/kernel/netns"
 )
 
 //nolint:staticcheck // TODO(NET) Fix staticcheck linter
@@ -58,7 +57,7 @@ type Socket struct {
 func NewSocket(netNS netns.NsHandle) (*Socket, error) {
 	var fd int
 	var err error
-	err = kernel.WithNS(netNS, func() error {
+	err = netnsutil.WithNS(netNS, func() error {
 		fd, err = unix.Socket(
 			unix.AF_NETLINK,
 			unix.SOCK_RAW|unix.SOCK_CLOEXEC,
diff --git a/pkg/network/port.go b/pkg/network/port.go
index cce191d64238..fbfd3c4ccb45 100644
--- a/pkg/network/port.go
+++ b/pkg/network/port.go
@@ -16,6 +16,7 @@ import (
 	"time"
 
 	"github.com/DataDog/datadog-agent/pkg/util/kernel"
+	"github.com/DataDog/datadog-agent/pkg/util/kernel/netns"
 	"github.com/DataDog/datadog-agent/pkg/util/log"
 )
 
@@ -51,7 +52,7 @@ func readState(procRoot string, paths []string, status int64) (map[PortMapping]u
 	seen := make(map[uint32]struct{})
 	allports := make(map[PortMapping]uint32)
 	err := kernel.WithAllProcs(procRoot, func(pid int) error {
-		ns, err := kernel.GetNetNsInoFromPid(procRoot, pid)
+		ns, err := netns.GetNetNsInoFromPid(procRoot, pid)
 		if err != nil {
 			if !errors.Is(err, os.ErrNotExist) {
 				log.Errorf("error getting net ns for pid %d: %s", pid, err)
diff --git a/pkg/network/port_test.go b/pkg/network/port_test.go
index 067417ae79d4..4f490c2107d1 100644
--- a/pkg/network/port_test.go
+++ b/pkg/network/port_test.go
@@ -22,7 +22,7 @@ import (
 	"github.com/vishvananda/netns"
 
 	netlinktestutil "github.com/DataDog/datadog-agent/pkg/network/netlink/testutil"
-	"github.com/DataDog/datadog-agent/pkg/util/kernel"
+	netnsutil "github.com/DataDog/datadog-agent/pkg/util/kernel/netns"
 	"github.com/DataDog/datadog-agent/pkg/util/log"
 )
 
@@ -58,7 +58,7 @@ func runServerProcess(t *testing.T, proto string, port uint16, ns netns.NsHandle
 	}
 
 	var proc *os.Process
-	kernel.WithNS(ns, func() error {
+	netnsutil.WithNS(ns, func() error {
 		cmd := exec.Command("socat", "-d", "-d", "STDIO", address)
 		stderr, err := cmd.StderrPipe()
 		require.NoError(t, err, "error getting stderr pipe for command %s", cmd)
@@ -104,7 +104,7 @@ func testReadListeningPorts(t *testing.T, proto string) {
 	ns, err = netns.GetFromName(nsName)
 	require.NoError(t, err)
 	t.Cleanup(func() { ns.Close() })
-	rootNs, err = kernel.GetRootNetNamespace("/proc")
+	rootNs, err = netnsutil.GetRootNetNamespace("/proc")
 	require.NoError(t, err)
 	t.Cleanup(func() { rootNs.Close() })
 
@@ -147,9 +147,9 @@ func testReadListeningPorts(t *testing.T, proto string) {
 		require.Less(t, i, 5, "failed to find unique port for proto %s", proto)
 	}
 
-	rootNsIno, err := kernel.GetInoForNs(rootNs)
+	rootNsIno, err := netnsutil.GetInoForNs(rootNs)
 	require.NoError(t, err)
-	nsIno, err := kernel.GetInoForNs(ns)
+	nsIno, err := netnsutil.GetInoForNs(ns)
 	require.NoError(t, err)
 
 	connType := TCP
diff --git a/pkg/network/route_cache.go b/pkg/network/route_cache.go
index 44a675b0f649..838ca79f4337 100644
--- a/pkg/network/route_cache.go
+++ b/pkg/network/route_cache.go
@@ -22,7 +22,7 @@ import (
 	telemetryComponent "github.com/DataDog/datadog-agent/comp/core/telemetry"
 	"github.com/DataDog/datadog-agent/pkg/process/util"
 	"github.com/DataDog/datadog-agent/pkg/telemetry"
-	"github.com/DataDog/datadog-agent/pkg/util/kernel"
+	netnsutil "github.com/DataDog/datadog-agent/pkg/util/kernel/netns"
 	"github.com/DataDog/datadog-agent/pkg/util/log"
 )
 
@@ -199,14 +199,14 @@ type netlinkRouter struct {
 
 // NewNetlinkRouter create a Router that queries routes via netlink
 func NewNetlinkRouter(rootNs netns.NsHandle) (Router, error) {
-	rootNsIno, err := kernel.GetInoForNs(rootNs)
+	rootNsIno, err := netnsutil.GetInoForNs(rootNs)
 	if err != nil {
 		return nil, fmt.Errorf("netlink gw cache backing: could not get root net ns: %w", err)
 	}
 
 	var fd int
 	var nlHandle *netlink.Handle
-	err = kernel.WithNS(rootNs, func() (sockErr error) {
+	err = netnsutil.WithNS(rootNs, func() (sockErr error) {
 		if fd, err = unix.Socket(unix.AF_INET, unix.SOCK_STREAM, 0); err != nil {
 			return err
 		}
diff --git a/pkg/network/testutil/server.go b/pkg/network/testutil/server.go
index b6d74337e171..62131575b5c0 100644
--- a/pkg/network/testutil/server.go
+++ b/pkg/network/testutil/server.go
@@ -20,7 +20,7 @@ import (
 	"github.com/stretchr/testify/require"
 	"github.com/vishvananda/netns"
 
-	"github.com/DataDog/datadog-agent/pkg/util/kernel"
+	netnsutil "github.com/DataDog/datadog-agent/pkg/util/kernel/netns"
 )
 
 // StartServerTCPNs is identical to StartServerTCP, but it operates with the
@@ -30,7 +30,7 @@ func StartServerTCPNs(t testing.TB, ip net.IP, port int, ns string) io.Closer {
 	require.NoError(t, err)
 
 	var closer io.Closer
-	err = kernel.WithNS(h, func() error {
+	err = netnsutil.WithNS(h, func() error {
 		closer = StartServerTCP(t, ip, port)
 		return nil
 	})
@@ -88,7 +88,7 @@ func StartServerUDPNs(t *testing.T, ip net.IP, port int, ns string) io.Closer {
 	require.NoError(t, err)
 
 	var closer io.Closer
-	err = kernel.WithNS(h, func() error {
+	err = netnsutil.WithNS(h, func() error {
 		closer = StartServerUDP(t, ip, port)
 		return nil
 	})
diff --git a/pkg/network/tracer/cached_conntrack.go b/pkg/network/tracer/cached_conntrack.go
index c5ee2d815564..f3a39ba340ee 100644
--- a/pkg/network/tracer/cached_conntrack.go
+++ b/pkg/network/tracer/cached_conntrack.go
@@ -20,7 +20,7 @@ import (
 
 	"github.com/DataDog/datadog-agent/pkg/network"
 	"github.com/DataDog/datadog-agent/pkg/network/netlink"
-	"github.com/DataDog/datadog-agent/pkg/util/kernel"
+	netnsutil "github.com/DataDog/datadog-agent/pkg/util/kernel/netns"
 	"github.com/DataDog/datadog-agent/pkg/util/log"
 )
 
@@ -145,7 +145,7 @@ func (cache *cachedConntrack) ensureConntrack(ino uint64, pid int) (netlink.Conn
 		return nil, nil
 	}
 
-	ns, err := kernel.GetNetNamespaceFromPid(cache.procRoot, pid)
+	ns, err := netnsutil.GetNetNamespaceFromPid(cache.procRoot, pid)
 	if err != nil {
 		if errors.Is(err, os.ErrNotExist) {
 			return nil, nil
diff --git a/pkg/network/tracer/connection/ebpfless/ports.go b/pkg/network/tracer/connection/ebpfless/ports.go
index 00ebebf273c6..8e5c5028d1f8 100644
--- a/pkg/network/tracer/connection/ebpfless/ports.go
+++ b/pkg/network/tracer/connection/ebpfless/ports.go
@@ -15,7 +15,7 @@ import (
 
 	"github.com/DataDog/datadog-agent/pkg/network"
 	"github.com/DataDog/datadog-agent/pkg/network/config"
-	"github.com/DataDog/datadog-agent/pkg/util/kernel"
+	"github.com/DataDog/datadog-agent/pkg/util/kernel/netns"
 	"github.com/DataDog/datadog-agent/pkg/util/log"
 )
 
@@ -38,7 +38,7 @@ type BoundPorts struct {
 
 // NewBoundPorts returns a new BoundPorts instance
 func NewBoundPorts(cfg *config.Config) *BoundPorts {
-	ino, _ := kernel.GetCurrentIno()
+	ino, _ := netns.GetCurrentIno()
 	return &BoundPorts{
 		config: cfg,
 		ports:  map[boundPortsKey]struct{}{},
diff --git a/pkg/network/tracer/conntracker_test.go b/pkg/network/tracer/conntracker_test.go
index 948d1a795bbf..0858773caec6 100644
--- a/pkg/network/tracer/conntracker_test.go
+++ b/pkg/network/tracer/conntracker_test.go
@@ -29,6 +29,7 @@ import (
 	nettestutil "github.com/DataDog/datadog-agent/pkg/network/testutil"
 	"github.com/DataDog/datadog-agent/pkg/process/util"
 	"github.com/DataDog/datadog-agent/pkg/util/kernel"
+	netnsutil "github.com/DataDog/datadog-agent/pkg/util/kernel/netns"
 )
 
 func TestConntrackers(t *testing.T) {
@@ -133,7 +134,7 @@ func testConntracker(t *testing.T, serverIP, clientIP net.IP, ct netlink.Conntra
 		family = network.AFINET6
 	}
 
-	curNs, err := kernel.GetCurrentIno()
+	curNs, err := netnsutil.GetCurrentIno()
 	require.NoError(t, err)
 	t.Logf("ns: %d", curNs)
 
@@ -217,7 +218,7 @@ func testConntrackerCrossNamespace(t *testing.T, ct netlink.Conntracker) {
 	testNs, err := netns.GetFromName(ns)
 	require.NoError(t, err)
 	defer testNs.Close()
-	testIno, err := kernel.GetInoForNs(testNs)
+	testIno, err := netnsutil.GetInoForNs(testNs)
 	require.NoError(t, err)
 	t.Logf("test ns: %d", testIno)
 
@@ -265,7 +266,7 @@ func testConntrackerCrossNamespaceNATonRoot(t *testing.T, ct netlink.Conntracker
 		testNS, err := netns.GetFromName(ns)
 		require.NoError(t, err)
 
-		testIno, err = kernel.GetInoForNs(testNS)
+		testIno, err = netnsutil.GetInoForNs(testNS)
 		require.NoError(t, err)
 
 		defer netns.Set(originalNS)
diff --git a/pkg/network/tracer/ebpf_conntracker.go b/pkg/network/tracer/ebpf_conntracker.go
index 873ee9d45300..72c6a93a30e0 100644
--- a/pkg/network/tracer/ebpf_conntracker.go
+++ b/pkg/network/tracer/ebpf_conntracker.go
@@ -37,6 +37,7 @@ import (
 	ebpfkernel "github.com/DataDog/datadog-agent/pkg/security/ebpf/kernel"
 	"github.com/DataDog/datadog-agent/pkg/telemetry"
 	"github.com/DataDog/datadog-agent/pkg/util/kernel"
+	"github.com/DataDog/datadog-agent/pkg/util/kernel/netns"
 	"github.com/DataDog/datadog-agent/pkg/util/log"
 	ddsync "github.com/DataDog/datadog-agent/pkg/util/sync"
 )
@@ -144,7 +145,7 @@ func NewEBPFConntracker(cfg *config.Config, telemetrycomp telemetryComp.Componen
 		return nil, fmt.Errorf("unable to get telemetry map: %w", err)
 	}
 
-	rootNS, err := kernel.GetNetNsInoFromPid(cfg.ProcRoot, 1)
+	rootNS, err := netns.GetNetNsInoFromPid(cfg.ProcRoot, 1)
 	if err != nil {
 		return nil, fmt.Errorf("could not find network root namespace: %w", err)
 	}
diff --git a/pkg/network/tracer/offsetguess/conntrack.go b/pkg/network/tracer/offsetguess/conntrack.go
index 60752a56ae90..9acf0717dd78 100644
--- a/pkg/network/tracer/offsetguess/conntrack.go
+++ b/pkg/network/tracer/offsetguess/conntrack.go
@@ -25,6 +25,7 @@ import (
 	"github.com/DataDog/datadog-agent/pkg/network/config"
 	"github.com/DataDog/datadog-agent/pkg/network/ebpf/probes"
 	"github.com/DataDog/datadog-agent/pkg/util/kernel"
+	netnsutil "github.com/DataDog/datadog-agent/pkg/util/kernel/netns"
 	"github.com/DataDog/datadog-agent/pkg/util/log"
 )
 
@@ -252,7 +253,7 @@ func (c *conntrackOffsetGuesser) Guess(cfg *config.Config) ([]manager.ConstantEd
 	defer currentNs.Close()
 	nss = append(nss, currentNs)
 
-	rootNs, err := kernel.GetRootNetNamespace(kernel.ProcFSRoot())
+	rootNs, err := netnsutil.GetRootNetNamespace(kernel.ProcFSRoot())
 	if err != nil {
 		return nil, err
 	}
@@ -331,7 +332,7 @@ func newConntrackEventGenerator(ns netns.NsHandle) (*conntrackEventGenerator, er
 	// port 0 means we let the kernel choose a free port
 	var err error
 	addr := fmt.Sprintf("%s:0", listenIPv4)
-	err = kernel.WithNS(eg.ns, func() error {
+	err = netnsutil.WithNS(eg.ns, func() error {
 		eg.udpAddr, eg.udpDone, err = newUDPServer(addr)
 		return err
 	})
@@ -351,7 +352,7 @@ func (e *conntrackEventGenerator) Generate(status GuessWhat, expected *fieldValu
 			e.udpConn.Close()
 		}
 		var err error
-		err = kernel.WithNS(e.ns, func() error {
+		err = netnsutil.WithNS(e.ns, func() error {
 			// we use a dialer instance to override the local
 			// address to use with the udp connection. this is
 			// because on kernel 4.4 using the default loopback
@@ -389,7 +390,7 @@ func (e *conntrackEventGenerator) populateUDPExpectedValues(expected *fieldValue
 
 	expected.saddr = saddr
 	expected.daddr = daddr
-	expected.netns, err = kernel.GetCurrentIno()
+	expected.netns, err = netnsutil.GetCurrentIno()
 	if err != nil {
 		return err
 	}
diff --git a/pkg/network/tracer/offsetguess/tracer.go b/pkg/network/tracer/offsetguess/tracer.go
index 1f2fa420074d..2032a53cce51 100644
--- a/pkg/network/tracer/offsetguess/tracer.go
+++ b/pkg/network/tracer/offsetguess/tracer.go
@@ -32,6 +32,7 @@ import (
 	netebpf "github.com/DataDog/datadog-agent/pkg/network/ebpf"
 	"github.com/DataDog/datadog-agent/pkg/network/ebpf/probes"
 	"github.com/DataDog/datadog-agent/pkg/util/kernel"
+	"github.com/DataDog/datadog-agent/pkg/util/kernel/netns"
 	"github.com/DataDog/datadog-agent/pkg/util/log"
 )
 
@@ -157,7 +158,7 @@ func extractIPv6AddressAndPort(addr net.Addr) (ip [4]uint32, port uint16, err er
 }
 
 func expectedValues(conn net.Conn) (*fieldValues, error) {
-	netns, err := kernel.GetCurrentIno()
+	netns, err := netns.GetCurrentIno()
 	if err != nil {
 		return nil, err
 	}
diff --git a/pkg/network/tracer/tracer.go b/pkg/network/tracer/tracer.go
index 928bb6ba63fd..4a30f2adba50 100644
--- a/pkg/network/tracer/tracer.go
+++ b/pkg/network/tracer/tracer.go
@@ -42,6 +42,7 @@ import (
 	"github.com/DataDog/datadog-agent/pkg/telemetry"
 	"github.com/DataDog/datadog-agent/pkg/util/ec2"
 	"github.com/DataDog/datadog-agent/pkg/util/kernel"
+	netnsutil "github.com/DataDog/datadog-agent/pkg/util/kernel/netns"
 	"github.com/DataDog/datadog-agent/pkg/util/ktime"
 	"github.com/DataDog/datadog-agent/pkg/util/log"
 )
@@ -808,7 +809,7 @@ func (t *Tracer) DebugCachedConntrack(ctx context.Context) (*DebugConntrackTable
 	}
 	defer ns.Close()
 
-	rootNS, err := kernel.GetInoForNs(ns)
+	rootNS, err := netnsutil.GetInoForNs(ns)
 	if err != nil {
 		return nil, err
 	}
@@ -832,7 +833,7 @@ func (t *Tracer) DebugHostConntrack(ctx context.Context) (*DebugConntrackTable,
 	}
 	defer ns.Close()
 
-	rootNS, err := kernel.GetInoForNs(ns)
+	rootNS, err := netnsutil.GetInoForNs(ns)
 	if err != nil {
 		return nil, err
 	}
@@ -891,7 +892,7 @@ func newUSMMonitor(c *config.Config, tracer connection.Tracer, statsd statsd.Cli
 // GetNetworkID retrieves the vpc_id (network_id) from IMDS
 func (t *Tracer) GetNetworkID(context context.Context) (string, error) {
 	id := ""
-	err := kernel.WithRootNS(kernel.ProcFSRoot(), func() error {
+	err := netnsutil.WithRootNS(kernel.ProcFSRoot(), func() error {
 		var err error
 		id, err = ec2.GetNetworkID(context)
 		return err
diff --git a/pkg/network/tracer/tracer_linux_test.go b/pkg/network/tracer/tracer_linux_test.go
index 64f287f9f20c..0a659e056390 100644
--- a/pkg/network/tracer/tracer_linux_test.go
+++ b/pkg/network/tracer/tracer_linux_test.go
@@ -62,6 +62,7 @@ import (
 	usmconfig "github.com/DataDog/datadog-agent/pkg/network/usm/config"
 	"github.com/DataDog/datadog-agent/pkg/process/util"
 	"github.com/DataDog/datadog-agent/pkg/util/kernel"
+	"github.com/DataDog/datadog-agent/pkg/util/kernel/netns"
 	"github.com/DataDog/datadog-agent/pkg/util/testutil/flake"
 )
 
@@ -916,7 +917,7 @@ func (s *TracerSuite) TestGatewayLookupCrossNamespace() {
 
 	// run tcp server in test1 net namespace
 	var server *tracertestutil.TCPServer
-	err = kernel.WithNS(test1Ns, func() error {
+	err = netns.WithNS(test1Ns, func() error {
 		server = tracertestutil.NewTCPServerOnAddress("2.2.2.2:0", func(_ net.Conn) {})
 		return server.Run()
 	})
@@ -954,7 +955,7 @@ func (s *TracerSuite) TestGatewayLookupCrossNamespace() {
 		defer test2Ns.Close()
 
 		var c net.Conn
-		err = kernel.WithNS(test2Ns, func() error {
+		err = netns.WithNS(test2Ns, func() error {
 			var err error
 			c, err = server.Dial()
 			return err
@@ -986,7 +987,7 @@ func (s *TracerSuite) TestGatewayLookupCrossNamespace() {
 		var clientIP string
 		var clientPort int
 		require.EventuallyWithT(t, func(c *assert.CollectT) {
-			kernel.WithNS(test2Ns, func() error {
+			netns.WithNS(test2Ns, func() error {
 				clientIP, clientPort, _, err = testdns.SendDNSQueries([]string{"google.com"}, dnsAddr, "udp")
 				return nil
 			})
diff --git a/pkg/network/usm/procnet/procnet.go b/pkg/network/usm/procnet/procnet.go
index 14d3056e13e5..3a5015ec2980 100644
--- a/pkg/network/usm/procnet/procnet.go
+++ b/pkg/network/usm/procnet/procnet.go
@@ -23,6 +23,7 @@ import (
 	"syscall"
 
 	"github.com/DataDog/datadog-agent/pkg/util/kernel"
+	"github.com/DataDog/datadog-agent/pkg/util/kernel/netns"
 )
 
 // TCPConnection encapsulates information for a TCP connection.
@@ -53,7 +54,7 @@ func GetTCPConnections() []TCPConnection {
 	)
 
 	_ = kernel.WithAllProcs(procRoot, func(pid int) error {
-		ino, err := kernel.GetNetNsInoFromPid(procRoot, pid)
+		ino, err := netns.GetNetNsInoFromPid(procRoot, pid)
 		if err != nil {
 			return nil
 		}
diff --git a/pkg/networkpath/traceroute/runner/runner.go b/pkg/networkpath/traceroute/runner/runner.go
index d7814a4769bb..30ecc3481895 100644
--- a/pkg/networkpath/traceroute/runner/runner.go
+++ b/pkg/networkpath/traceroute/runner/runner.go
@@ -28,7 +28,7 @@ import (
 	"github.com/DataDog/datadog-agent/pkg/process/util"
 	"github.com/DataDog/datadog-agent/pkg/telemetry"
 	cloudprovidersnetwork "github.com/DataDog/datadog-agent/pkg/util/cloudproviders/network"
-	"github.com/DataDog/datadog-agent/pkg/util/kernel"
+	netnsutil "github.com/DataDog/datadog-agent/pkg/util/kernel/netns"
 	"github.com/DataDog/datadog-agent/pkg/util/log"
 	"github.com/DataDog/datadog-agent/pkg/version"
 )
@@ -265,7 +265,7 @@ func createGatewayLookup(telemetryComp telemetryComponent.Component) (network.Ga
 	}
 	defer rootNs.Close()
 
-	nsIno, err := kernel.GetInoForNs(rootNs)
+	nsIno, err := netnsutil.GetInoForNs(rootNs)
 	if err != nil {
 		return nil, 0, fmt.Errorf("failed to get inode number: %w", err)
 	}
diff --git a/pkg/process/monitor/process_monitor.go b/pkg/process/monitor/process_monitor.go
index cdc1770ddb48..f2d698918943 100644
--- a/pkg/process/monitor/process_monitor.go
+++ b/pkg/process/monitor/process_monitor.go
@@ -21,6 +21,7 @@ import (
 	"github.com/DataDog/datadog-agent/pkg/network/protocols/telemetry"
 	"github.com/DataDog/datadog-agent/pkg/runtime"
 	"github.com/DataDog/datadog-agent/pkg/util/kernel"
+	"github.com/DataDog/datadog-agent/pkg/util/kernel/netns"
 	"github.com/DataDog/datadog-agent/pkg/util/log"
 )
 
@@ -208,7 +209,7 @@ func (pm *ProcessMonitor) initNetlinkProcessEventMonitor() error {
 	pm.netlinkErrorsChannel = make(chan error, 10)
 	pm.netlinkEventsChannel = make(chan netlink.ProcEvent, processMonitorEventQueueSize)
 
-	if err := kernel.WithRootNS(kernel.ProcFSRoot(), func() error {
+	if err := netns.WithRootNS(kernel.ProcFSRoot(), func() error {
 		return netlink.ProcEventMonitor(pm.netlinkEventsChannel, pm.netlinkDoneChannel, pm.netlinkErrorsChannel, netlink.PROC_EVENT_EXEC|netlink.PROC_EVENT_EXIT)
 	}); err != nil {
 		return fmt.Errorf("couldn't initialize process monitor: %s", err)
@@ -382,7 +383,7 @@ func (pm *ProcessMonitor) Initialize(useEventStream bool) error {
 
 			go pm.mainEventLoop()
 
-			if err := kernel.WithRootNS(kernel.ProcFSRoot(), func() error {
+			if err := netns.WithRootNS(kernel.ProcFSRoot(), func() error {
 				return netlink.ProcEventMonitor(pm.netlinkEventsChannel, pm.netlinkDoneChannel, pm.netlinkErrorsChannel, netlink.PROC_EVENT_EXEC|netlink.PROC_EVENT_EXIT)
 			}); err != nil {
 				initErr = fmt.Errorf("couldn't initialize process monitor: %w", err)
diff --git a/pkg/process/monitor/process_monitor_test.go b/pkg/process/monitor/process_monitor_test.go
index b0942f2f6d79..298467c5957d 100644
--- a/pkg/process/monitor/process_monitor_test.go
+++ b/pkg/process/monitor/process_monitor_test.go
@@ -22,7 +22,7 @@ import (
 	"github.com/DataDog/datadog-agent/pkg/eventmonitor/consumers/testutil"
 	"github.com/DataDog/datadog-agent/pkg/network/protocols/telemetry"
 	"github.com/DataDog/datadog-agent/pkg/util/filesystem"
-	"github.com/DataDog/datadog-agent/pkg/util/kernel"
+	netnsutil "github.com/DataDog/datadog-agent/pkg/util/kernel/netns"
 )
 
 func getProcessMonitor(t *testing.T) *ProcessMonitor {
@@ -242,7 +242,7 @@ func (s *processMonitorSuite) TestProcessMonitorInNamespace() {
 	require.NoError(t, err, "could not create network namespace for process monitor")
 	t.Cleanup(func() { monNs.Close() })
 
-	require.NoError(t, kernel.WithNS(monNs, func() error {
+	require.NoError(t, netnsutil.WithNS(monNs, func() error {
 		initializePM(t, pm, s.useEventStream)
 		return nil
 	}), "could not start process monitor in netNS")
@@ -265,7 +265,7 @@ func (s *processMonitorSuite) TestProcessMonitorInNamespace() {
 	defer cmdNs.Close()
 
 	cmd = exec.Command("/bin/sleep", "1")
-	require.NoError(t, kernel.WithNS(cmdNs, cmd.Run), "could not run process in other network namespace")
+	require.NoError(t, netnsutil.WithNS(cmdNs, cmd.Run), "could not run process in other network namespace")
 	pid = uint32(cmd.ProcessState.Pid())
 
 	require.EventuallyWithTf(t, func(ct *assert.CollectT) {
diff --git a/pkg/util/kernel/netns.go b/pkg/util/kernel/netns/netns.go
similarity index 94%
rename from pkg/util/kernel/netns.go
rename to pkg/util/kernel/netns/netns.go
index bd9d4e2664dd..b28f7d92006e 100644
--- a/pkg/util/kernel/netns.go
+++ b/pkg/util/kernel/netns/netns.go
@@ -5,7 +5,8 @@
 
 //go:build linux
 
-package kernel
+// Package netns provides utility functions for network ns handling on linux platform.
+package netns
 
 import (
 	"errors"
@@ -18,6 +19,7 @@ import (
 	"github.com/vishvananda/netns"
 	"golang.org/x/sys/unix"
 
+	"github.com/DataDog/datadog-agent/pkg/util/kernel"
 	"github.com/DataDog/datadog-agent/pkg/util/log"
 )
 
@@ -71,7 +73,7 @@ func WithNS(ns netns.NsHandle, fn func() error) error {
 func GetNetNamespaces(procRoot string) ([]netns.NsHandle, error) {
 	var nss []netns.NsHandle
 	seen := make(map[string]interface{})
-	err := WithAllProcs(procRoot, func(pid int) error {
+	err := kernel.WithAllProcs(procRoot, func(pid int) error {
 		ns, err := netns.GetFromPath(path.Join(procRoot, fmt.Sprintf("%d/ns/net", pid)))
 		if err != nil {
 			if !errors.Is(err, os.ErrNotExist) && !errors.Is(err, unix.ENOENT) {
diff --git a/pkg/util/kernel/netns_darwin.go b/pkg/util/kernel/netns/netns_darwin.go
similarity index 91%
rename from pkg/util/kernel/netns_darwin.go
rename to pkg/util/kernel/netns/netns_darwin.go
index 900219cc9a17..dbe5b4d7157d 100644
--- a/pkg/util/kernel/netns_darwin.go
+++ b/pkg/util/kernel/netns/netns_darwin.go
@@ -3,7 +3,8 @@
 // This product includes software developed at Datadog (https://www.datadoghq.com/).
 // Copyright 2016-present Datadog, Inc.
 
-package kernel
+// Package netns is not supported on MacOS.
+package netns
 
 import (
 	"fmt"
diff --git a/pkg/util/kernel/netns_windows.go b/pkg/util/kernel/netns/netns_windows.go
similarity index 91%
rename from pkg/util/kernel/netns_windows.go
rename to pkg/util/kernel/netns/netns_windows.go
index 900219cc9a17..3347dd10b7e5 100644
--- a/pkg/util/kernel/netns_windows.go
+++ b/pkg/util/kernel/netns/netns_windows.go
@@ -3,7 +3,8 @@
 // This product includes software developed at Datadog (https://www.datadoghq.com/).
 // Copyright 2016-present Datadog, Inc.
 
-package kernel
+// Package netns is not supported on Windows.
+package netns
 
 import (
 	"fmt"


Reviews:
user: login: guyarb
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-26T09:38:34Z
user: login: guyarb
state: APPROVED
author_association: CONTRIBUTOR
submitted_at: 2025-03-26T09:39:06Z
user: login: vitkyrka
state: APPROVED
author_association: CONTRIBUTOR
submitted_at: 2025-03-26T12:43:14Z
user: login: gjulianm
state: APPROVED
author_association: CONTRIBUTOR
submitted_at: 2025-03-26T12:54:31Z
user: login: hmahmood
state: APPROVED
author_association: CONTRIBUTOR
submitted_at: 2025-03-26T14:41:39Z
user: login: brycekahle
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-26T15:59:38Z

Review comments:
diff_hunk: @@ -492,6 +492,7 @@
 /pkg/util/funcs/                        @DataDog/ebpf-platform
 /pkg/util/gpu/                          @DataDog/container-platform
 /pkg/util/kernel/                       @DataDog/ebpf-platform
+/pkg/util/kernel/ns                     @DataDog/ebpf-platform
path: .github/CODEOWNERS
user: login: guyarb
body: not needed, as line 494 captures it
created_at: 2025-03-26T09:38:34Z
author_association: CONTRIBUTOR
path: pkg/util/kernel/ns/netns.go
user: login: brycekahle
body: If this package is specifically about network namespaces, should it be named `netns` rather than `ns`?
created_at: 2025-03-26T15:59:38Z
author_association: MEMBER

PR comments:
user: login: cit-pr-commenter[bot]
created_at: 2025-03-26T09:46:45Z
body: ## Go Package Import Differences

Baseline: 39faaf5f2d9ac5d2f8bb3af0838d802f5f7427c6
Comparison: f88b82e0f88736d4e660c7515812303b7723f3f4

<table><thead><tr><th>binary</th><th>os</th><th>arch</th><th>change</th></tr></thead><tbody>
<tr><td>agent</td><td>windows</td><td>amd64</td><td><details><summary>+0, -1</summary>
<pre lang='diff'>
-github.com/vishvananda/netns
</pre></details></td></tr>
<tr><td>agent</td><td>darwin</td><td>amd64</td><td><details><summary>+1, -0</summary>
<pre lang='diff'>
+github.com/DataDog/datadog-agent/pkg/util/kernel/netns
</pre></details></td></tr>
<tr><td>agent</td><td>darwin</td><td>arm64</td><td><details><summary>+1, -0</summary>
<pre lang='diff'>
+github.com/DataDog/datadog-agent/pkg/util/kernel/netns
</pre></details></td></tr>
<tr><td>iot-agent</td><td>linux</td><td>amd64</td><td><details><summary>+0, -1</summary>
<pre lang='diff'>
-github.com/vishvananda/netns
</pre></details></td></tr>
<tr><td>iot-agent</td><td>linux</td><td>arm64</td><td><details><summary>+0, -1</summary>
<pre lang='diff'>
-github.com/vishvananda/netns
</pre></details></td></tr>
<tr><td>heroku-agent</td><td>linux</td><td>amd64</td><td><details><summary>+0, -1</summary>
<pre lang='diff'>
-github.com/vishvananda/netns
</pre></details></td></tr>
<tr><td>cluster-agent</td><td>linux</td><td>amd64</td><td><details><summary>+0, -1</summary>
<pre lang='diff'>
-github.com/vishvananda/netns
</pre></details></td></tr>
<tr><td>cluster-agent</td><td>linux</td><td>arm64</td><td><details><summary>+0, -1</summary>
<pre lang='diff'>
-github.com/vishvananda/netns
</pre></details></td></tr>
<tr><td>cluster-agent-cloudfoundry</td><td>linux</td><td>amd64</td><td><details><summary>+0, -1</summary>
<pre lang='diff'>
-github.com/vishvananda/netns
</pre></details></td></tr>
<tr><td>cluster-agent-cloudfoundry</td><td>linux</td><td>arm64</td><td><details><summary>+0, -1</summary>
<pre lang='diff'>
-github.com/vishvananda/netns
</pre></details></td></tr>
<tr><td>process-agent</td><td>windows</td><td>amd64</td><td><details><summary>+0, -1</summary>
<pre lang='diff'>
-github.com/vishvananda/netns
</pre></details></td></tr>
<tr><td>process-agent</td><td>darwin</td><td>amd64</td><td><details><summary>+1, -0</summary>
<pre lang='diff'>
+github.com/DataDog/datadog-agent/pkg/util/kernel/netns
</pre></details></td></tr>
<tr><td>process-agent</td><td>darwin</td><td>arm64</td><td><details><summary>+1, -0</summary>
<pre lang='diff'>
+github.com/DataDog/datadog-agent/pkg/util/kernel/netns
</pre></details></td></tr>
<tr><td>heroku-process-agent</td><td>linux</td><td>amd64</td><td><details><summary>+0, -1</summary>
<pre lang='diff'>
-github.com/vishvananda/netns
</pre></details></td></tr>
<tr><td>security-agent</td><td>windows</td><td>amd64</td><td><details><summary>+0, -1</summary>
<pre lang='diff'>
-github.com/vishvananda/netns
</pre></details></td></tr>
<tr><td>system-probe</td><td>linux</td><td>amd64</td><td><details><summary>+1, -0</summary>
<pre lang='diff'>
+github.com/DataDog/datadog-agent/pkg/util/kernel/netns
</pre></details></td></tr>
<tr><td>system-probe</td><td>linux</td><td>arm64</td><td><details><summary>+1, -0</summary>
<pre lang='diff'>
+github.com/DataDog/datadog-agent/pkg/util/kernel/netns
</pre></details></td></tr>
<tr><td>system-probe</td><td>windows</td><td>amd64</td><td><details><summary>+1, -0</summary>
<pre lang='diff'>
+github.com/DataDog/datadog-agent/pkg/util/kernel/netns
</pre></details></td></tr>
</tbody></table>
author_association: NONE
user: login: agent-platform-auto-pr[bot]
created_at: 2025-03-26T10:00:42Z
body: ## Test changes on VM

Use this command from [test-infra-definitions](https://github.com/DataDog/test-infra-definitions) to manually test this PR changes on a VM:
```sh
dda inv aws.create-vm --pipeline-id=60064256 --os-family=ubuntu
```
Note: This applies to commit **f88b82e0**
author_association: CONTRIBUTOR
user: login: agent-platform-auto-pr[bot]
created_at: 2025-03-26T10:02:19Z
body: ## Uncompressed package size comparison

Comparison with [ancestor](https://github.com/DataDog/datadog-agent/commit/39faaf5f2d9ac5d2f8bb3af0838d802f5f7427c6) `39faaf5f2d9ac5d2f8bb3af0838d802f5f7427c6`
<details open>
<summary> Size reduction summary </summary>

|package|diff|status|size|ancestor|threshold|
|--|--|--|--|--|--|
|datadog-iot-agent-x86_64-rpm|-0.00MB|✅|61.17MB|61.17MB|0.50MB|
|datadog-iot-agent-x86_64-suse|-0.00MB|✅|61.17MB|61.17MB|0.50MB|
|datadog-iot-agent-aarch64-rpm|-0.00MB|✅|58.46MB|58.46MB|0.50MB|

</details>


<details>
  <summary> Diff per package </summary>

|package|diff|status|size|ancestor|threshold|
|--|--|--|--|--|--|
|datadog-agent-amd64-deb|0.00MB|✅|807.09MB|807.09MB|0.50MB|
|datadog-agent-x86_64-rpm|0.00MB|✅|816.94MB|816.94MB|0.50MB|
|datadog-agent-x86_64-suse|0.00MB|✅|816.94MB|816.94MB|0.50MB|
|datadog-agent-arm64-deb|0.00MB|✅|798.10MB|798.10MB|0.50MB|
|datadog-agent-aarch64-rpm|0.00MB|✅|807.92MB|807.92MB|0.50MB|
|datadog-dogstatsd-amd64-deb|0.00MB|✅|39.48MB|39.48MB|0.50MB|
|datadog-dogstatsd-x86_64-rpm|0.00MB|✅|39.56MB|39.56MB|0.50MB|
|datadog-dogstatsd-x86_64-suse|0.00MB|✅|39.56MB|39.56MB|0.50MB|
|datadog-dogstatsd-arm64-deb|0.00MB|✅|38.00MB|38.00MB|0.50MB|
|datadog-heroku-agent-amd64-deb|0.00MB|✅|442.21MB|442.21MB|0.50MB|
|datadog-iot-agent-amd64-deb|0.00MB|✅|61.09MB|61.09MB|0.50MB|
|datadog-iot-agent-arm64-deb|0.00MB|✅|58.38MB|58.38MB|0.50MB|

</details>

## Decision
✅ Passed



author_association: CONTRIBUTOR
user: login: cit-pr-commenter[bot]
created_at: 2025-03-26T10:26:44Z
body: ## Regression Detector

# Regression Detector Results

[Metrics dashboard](https://app.datadoghq.com/dashboard/ykh-ua8-vcu/SMP-Regression-Detector-Metrics?fromUser=true&refresh_mode=paused&tpl_var_run-id%5B0%5D=64eb7c4f-aad2-4418-a43a-a2b084acb5ba&view=spans&from_ts=1743007405000&to_ts=1743008005000&live=false)  
[Target profiles](https://app.datadoghq.com/profiling/explorer?query=env%3Asingle-machine-performance%20service%3Adatadog-agent%20job_id%3A64eb7c4f-aad2-4418-a43a-a2b084acb5ba&agg_m=count&agg_m_source=base&agg_t=count&fromUser=false&viz=stream&start=1743000205000&end=1743011605000&paused=true)  
Run ID: 64eb7c4f-aad2-4418-a43a-a2b084acb5ba

Baseline: 39faaf5f2d9ac5d2f8bb3af0838d802f5f7427c6
Comparison: f88b82e0f88736d4e660c7515812303b7723f3f4
[Diff](39faaf5f2d9ac5d2f8bb3af0838d802f5f7427c6...f88b82e0f88736d4e660c7515812303b7723f3f4)


## Optimization Goals: ✅ No significant changes detected


<details>
<summary><h2>
Fine details of change detection per experiment
</h2></summary>

| perf | experiment                                   | goal               | Δ mean % | Δ mean % CI    | trials | links                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
|------|----------------------------------------------|--------------------|----------|----------------|--------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ➖   | quality_gate_logs                            | % cpu utilization  | +1.19    | [-1.65, +4.03] | 1      | [Logs](https://app.datadoghq.com/logs?query=experiment%3Aquality_gate_logs%20run_id%3A64eb7c4f-aad2-4418-a43a-a2b084acb5ba&agg_m=count&agg_m_source=base&agg_q=%40span.url&agg_q_source=base&agg_t=count&fromUser=true&index=single-machine-performance-target-logs&messageDisplay=inline&refresh_mode=paused&storage=hot&stream_sort=time%2Cdesc&top_n=100&top_o=top&viz=stream&x_missing=true&from_ts=1743000205000&to_ts=1743011605000&live=false)                                                                                                                                                                                                                                                                                                                                                                          |
| ➖   | otlp_ingest_traces                           | memory utilization | +0.69    | [+0.31, +1.07] | 1      | [Logs](https://app.datadoghq.com/logs?query=experiment%3Aotlp_ingest_traces%20run_id%3A64eb7c4f-aad2-4418-a43a-a2b084acb5ba&agg_m=count&agg_m_source=base&agg_q=%40span.url&agg_q_source=base&agg_t=count&fromUser=true&index=single-machine-performance-target-logs&messageDisplay=inline&refresh_mode=paused&storage=hot&stream_sort=time%2Cdesc&top_n=100&top_o=top&viz=stream&x_missing=true&from_ts=1743000205000&to_ts=1743011605000&live=false)                                                                                                                                                                                                                                                                                                                                                                         |
| ➖   | file_to_blackhole_1000ms_latency             | egress throughput  | +0.14    | [-0.62, +0.91] | 1      | [Logs](https://app.datadoghq.com/logs?query=experiment%3Afile_to_blackhole_1000ms_latency%20run_id%3A64eb7c4f-aad2-4418-a43a-a2b084acb5ba&agg_m=count&agg_m_source=base&agg_q=%40span.url&agg_q_source=base&agg_t=count&fromUser=true&index=single-machine-performance-target-logs&messageDisplay=inline&refresh_mode=paused&storage=hot&stream_sort=time%2Cdesc&top_n=100&top_o=top&viz=stream&x_missing=true&from_ts=1743000205000&to_ts=1743011605000&live=false)                                                                                                                                                                                                                                                                                                                                                           |
| ➖   | otlp_ingest_logs                             | memory utilization | +0.11    | [-0.05, +0.28] | 1      | [Logs](https://app.datadoghq.com/logs?query=experiment%3Aotlp_ingest_logs%20run_id%3A64eb7c4f-aad2-4418-a43a-a2b084acb5ba&agg_m=count&agg_m_source=base&agg_q=%40span.url&agg_q_source=base&agg_t=count&fromUser=true&index=single-machine-performance-target-logs&messageDisplay=inline&refresh_mode=paused&storage=hot&stream_sort=time%2Cdesc&top_n=100&top_o=top&viz=stream&x_missing=true&from_ts=1743000205000&to_ts=1743011605000&live=false)                                                                                                                                                                                                                                                                                                                                                                           |
| ➖   | file_to_blackhole_500ms_latency              | egress throughput  | +0.05    | [-0.74, +0.85] | 1      | [Logs](https://app.datadoghq.com/logs?query=experiment%3Afile_to_blackhole_500ms_latency%20run_id%3A64eb7c4f-aad2-4418-a43a-a2b084acb5ba&agg_m=count&agg_m_source=base&agg_q=%40span.url&agg_q_source=base&agg_t=count&fromUser=true&index=single-machine-performance-target-logs&messageDisplay=inline&refresh_mode=paused&storage=hot&stream_sort=time%2Cdesc&top_n=100&top_o=top&viz=stream&x_missing=true&from_ts=1743000205000&to_ts=1743011605000&live=false)                                                                                                                                                                                                                                                                                                                                                            |
| ➖   | file_to_blackhole_100ms_latency              | egress throughput  | +0.02    | [-0.67, +0.71] | 1      | [Logs](https://app.datadoghq.com/logs?query=experiment%3Afile_to_blackhole_100ms_latency%20run_id%3A64eb7c4f-aad2-4418-a43a-a2b084acb5ba&agg_m=count&agg_m_source=base&agg_q=%40span.url&agg_q_source=base&agg_t=count&fromUser=true&index=single-machine-performance-target-logs&messageDisplay=inline&refresh_mode=paused&storage=hot&stream_sort=time%2Cdesc&top_n=100&top_o=top&viz=stream&x_missing=true&from_ts=1743000205000&to_ts=1743011605000&live=false)                                                                                                                                                                                                                                                                                                                                                            |
| ➖   | file_to_blackhole_0ms_latency                | egress throughput  | +0.02    | [-0.79, +0.82] | 1      | [Logs](https://app.datadoghq.com/logs?query=experiment%3Afile_to_blackhole_0ms_latency%20run_id%3A64eb7c4f-aad2-4418-a43a-a2b084acb5ba&agg_m=count&agg_m_source=base&agg_q=%40span.url&agg_q_source=base&agg_t=count&fromUser=true&index=single-machine-performance-target-logs&messageDisplay=inline&refresh_mode=paused&storage=hot&stream_sort=time%2Cdesc&top_n=100&top_o=top&viz=stream&x_missing=true&from_ts=1743000205000&to_ts=1743011605000&live=false)                                                                                                                                                                                                                                                                                                                                                              |
| ➖   | uds_dogstatsd_to_api                         | ingress throughput | +0.01    | [-0.26, +0.28] | 1      | [Logs](https://app.datadoghq.com/logs?query=experiment%3Auds_dogstatsd_to_api%20run_id%3A64eb7c4f-aad2-4418-a43a-a2b084acb5ba&agg_m=count&agg_m_source=base&agg_q=%40span.url&agg_q_source=base&agg_t=count&fromUser=true&index=single-machine-performance-target-logs&messageDisplay=inline&refresh_mode=paused&storage=hot&stream_sort=time%2Cdesc&top_n=100&top_o=top&viz=stream&x_missing=true&from_ts=1743000205000&to_ts=1743011605000&live=false)                                                                                                                                                                                                                                                                                                                                                                       |
| ➖   | file_to_blackhole_300ms_latency              | egress throughput  | +0.00    | [-0.63, +0.64] | 1      | [Logs](https://app.datadoghq.com/logs?query=experiment%3Afile_to_blackhole_300ms_latency%20run_id%3A64eb7c4f-aad2-4418-a43a-a2b084acb5ba&agg_m=count&agg_m_source=base&agg_q=%40span.url&agg_q_source=base&agg_t=count&fromUser=true&index=single-machine-performance-target-logs&messageDisplay=inline&refresh_mode=paused&storage=hot&stream_sort=time%2Cdesc&top_n=100&top_o=top&viz=stream&x_missing=true&from_ts=1743000205000&to_ts=1743011605000&live=false)                                                                                                                                                                                                                                                                                                                                                            |
| ➖   | file_to_blackhole_0ms_latency_http1          | egress throughput  | -0.01    | [-0.84, +0.82] | 1      | [Logs](https://app.datadoghq.com/logs?query=experiment%3Afile_to_blackhole_0ms_latency_http1%20run_id%3A64eb7c4f-aad2-4418-a43a-a2b084acb5ba&agg_m=count&agg_m_source=base&agg_q=%40span.url&agg_q_source=base&agg_t=count&fromUser=true&index=single-machine-performance-target-logs&messageDisplay=inline&refresh_mode=paused&storage=hot&stream_sort=time%2Cdesc&top_n=100&top_o=top&viz=stream&x_missing=true&from_ts=1743000205000&to_ts=1743011605000&live=false)                                                                                                                                                                                                                                                                                                                                                        |
| ➖   | tcp_dd_logs_filter_exclude                   | ingress throughput | -0.01    | [-0.04, +0.01] | 1      | [Logs](https://app.datadoghq.com/logs?query=experiment%3Atcp_dd_logs_filter_exclude%20run_id%3A64eb7c4f-aad2-4418-a43a-a2b084acb5ba&agg_m=count&agg_m_source=base&agg_q=%40span.url&agg_q_source=base&agg_t=count&fromUser=true&index=single-machine-performance-target-logs&messageDisplay=inline&refresh_mode=paused&storage=hot&stream_sort=time%2Cdesc&top_n=100&top_o=top&viz=stream&x_missing=true&from_ts=1743000205000&to_ts=1743011605000&live=false)                                                                                                                                                                                                                                                                                                                                                                 |
| ➖   | file_to_blackhole_0ms_latency_http2          | egress throughput  | -0.02    | [-0.79, +0.76] | 1      | [Logs](https://app.datadoghq.com/logs?query=experiment%3Afile_to_blackhole_0ms_latency_http2%20run_id%3A64eb7c4f-aad2-4418-a43a-a2b084acb5ba&agg_m=count&agg_m_source=base&agg_q=%40span.url&agg_q_source=base&agg_t=count&fromUser=true&index=single-machine-performance-target-logs&messageDisplay=inline&refresh_mode=paused&storage=hot&stream_sort=time%2Cdesc&top_n=100&top_o=top&viz=stream&x_missing=true&from_ts=1743000205000&to_ts=1743011605000&live=false)                                                                                                                                                                                                                                                                                                                                                        |
| ➖   | file_to_blackhole_1000ms_latency_linear_load | egress throughput  | -0.18    | [-0.64, +0.28] | 1      | [Logs](https://app.datadoghq.com/logs?query=experiment%3Afile_to_blackhole_1000ms_latency_linear_load%20run_id%3A64eb7c4f-aad2-4418-a43a-a2b084acb5ba&agg_m=count&agg_m_source=base&agg_q=%40span.url&agg_q_source=base&agg_t=count&fromUser=true&index=single-machine-performance-target-logs&messageDisplay=inline&refresh_mode=paused&storage=hot&stream_sort=time%2Cdesc&top_n=100&top_o=top&viz=stream&x_missing=true&from_ts=1743000205000&to_ts=1743011605000&live=false)                                                                                                                                                                                                                                                                                                                                               |
| ➖   | quality_gate_idle_all_features               | memory utilization | -0.33    | [-0.42, -0.24] | 1      | [Logs](https://app.datadoghq.com/logs?query=experiment%3Aquality_gate_idle_all_features%20run_id%3A64eb7c4f-aad2-4418-a43a-a2b084acb5ba&agg_m=count&agg_m_source=base&agg_q=%40span.url&agg_q_source=base&agg_t=count&fromUser=true&index=single-machine-performance-target-logs&messageDisplay=inline&refresh_mode=paused&storage=hot&stream_sort=time%2Cdesc&top_n=100&top_o=top&viz=stream&x_missing=true&from_ts=1743000205000&to_ts=1743011605000&live=false) [bounds checks dashboard](https://app.datadoghq.com/dashboard/vz3-jd5-bdi?fromUser=true&refresh_mode=paused&tpl_var_experiment%5B0%5D=quality_gate_idle_all_features&tpl_var_job_id%5B0%5D=64eb7c4f-aad2-4418-a43a-a2b084acb5ba&tpl_var_run-id%5B0%5D=64eb7c4f-aad2-4418-a43a-a2b084acb5ba&view=spans&from_ts=1743007405000&to_ts=1743008005000&live=false) |
| ➖   | otlp_ingest_metrics                          | memory utilization | -0.34    | [-0.48, -0.20] | 1      | [Logs](https://app.datadoghq.com/logs?query=experiment%3Aotlp_ingest_metrics%20run_id%3A64eb7c4f-aad2-4418-a43a-a2b084acb5ba&agg_m=count&agg_m_source=base&agg_q=%40span.url&agg_q_source=base&agg_t=count&fromUser=true&index=single-machine-performance-target-logs&messageDisplay=inline&refresh_mode=paused&storage=hot&stream_sort=time%2Cdesc&top_n=100&top_o=top&viz=stream&x_missing=true&from_ts=1743000205000&to_ts=1743011605000&live=false)                                                                                                                                                                                                                                                                                                                                                                        |
| ➖   | tcp_syslog_to_blackhole                      | ingress throughput | -0.37    | [-0.44, -0.30] | 1      | [Logs](https://app.datadoghq.com/logs?query=experiment%3Atcp_syslog_to_blackhole%20run_id%3A64eb7c4f-aad2-4418-a43a-a2b084acb5ba&agg_m=count&agg_m_source=base&agg_q=%40span.url&agg_q_source=base&agg_t=count&fromUser=true&index=single-machine-performance-target-logs&messageDisplay=inline&refresh_mode=paused&storage=hot&stream_sort=time%2Cdesc&top_n=100&top_o=top&viz=stream&x_missing=true&from_ts=1743000205000&to_ts=1743011605000&live=false)                                                                                                                                                                                                                                                                                                                                                                    |
| ➖   | file_tree                                    | memory utilization | -0.37    | [-0.58, -0.17] | 1      | [Logs](https://app.datadoghq.com/logs?query=experiment%3Afile_tree%20run_id%3A64eb7c4f-aad2-4418-a43a-a2b084acb5ba&agg_m=count&agg_m_source=base&agg_q=%40span.url&agg_q_source=base&agg_t=count&fromUser=true&index=single-machine-performance-target-logs&messageDisplay=inline&refresh_mode=paused&storage=hot&stream_sort=time%2Cdesc&top_n=100&top_o=top&viz=stream&x_missing=true&from_ts=1743000205000&to_ts=1743011605000&live=false)                                                                                                                                                                                                                                                                                                                                                                                  |
| ➖   | quality_gate_idle                            | memory utilization | -0.90    | [-0.96, -0.84] | 1      | [Logs](https://app.datadoghq.com/logs?query=experiment%3Aquality_gate_idle%20run_id%3A64eb7c4f-aad2-4418-a43a-a2b084acb5ba&agg_m=count&agg_m_source=base&agg_q=%40span.url&agg_q_source=base&agg_t=count&fromUser=true&index=single-machine-performance-target-logs&messageDisplay=inline&refresh_mode=paused&storage=hot&stream_sort=time%2Cdesc&top_n=100&top_o=top&viz=stream&x_missing=true&from_ts=1743000205000&to_ts=1743011605000&live=false) [bounds checks dashboard](https://app.datadoghq.com/dashboard/vz3-jd5-bdi?fromUser=true&refresh_mode=paused&tpl_var_experiment%5B0%5D=quality_gate_idle&tpl_var_job_id%5B0%5D=64eb7c4f-aad2-4418-a43a-a2b084acb5ba&tpl_var_run-id%5B0%5D=64eb7c4f-aad2-4418-a43a-a2b084acb5ba&view=spans&from_ts=1743007405000&to_ts=1743008005000&live=false)                           |
| ➖   | uds_dogstatsd_to_api_cpu                     | % cpu utilization  | -1.33    | [-2.17, -0.48] | 1      | [Logs](https://app.datadoghq.com/logs?query=experiment%3Auds_dogstatsd_to_api_cpu%20run_id%3A64eb7c4f-aad2-4418-a43a-a2b084acb5ba&agg_m=count&agg_m_source=base&agg_q=%40span.url&agg_q_source=base&agg_t=count&fromUser=true&index=single-machine-performance-target-logs&messageDisplay=inline&refresh_mode=paused&storage=hot&stream_sort=time%2Cdesc&top_n=100&top_o=top&viz=stream&x_missing=true&from_ts=1743000205000&to_ts=1743011605000&live=false)                                                                                                                                                                                                                                                                                                                                                                   |
| ➖   | uds_dogstatsd_20mb_12k_contexts_20_senders   | memory utilization | -1.44    | [-1.53, -1.36] | 1      | [Logs](https://app.datadoghq.com/logs?query=experiment%3Auds_dogstatsd_20mb_12k_contexts_20_senders%20run_id%3A64eb7c4f-aad2-4418-a43a-a2b084acb5ba&agg_m=count&agg_m_source=base&agg_q=%40span.url&agg_q_source=base&agg_t=count&fromUser=true&index=single-machine-performance-target-logs&messageDisplay=inline&refresh_mode=paused&storage=hot&stream_sort=time%2Cdesc&top_n=100&top_o=top&viz=stream&x_missing=true&from_ts=1743000205000&to_ts=1743011605000&live=false)                                                                                                                                                                                                                                                                                                                                                 |
</details>


## Bounds Checks: ❌ Failed

| perf | experiment                                   | bounds_check_name  | replicates_passed | links                                                                                                                                                                                                                                                                                                                                                       |
|------|----------------------------------------------|--------------------|-------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ❌   | file_to_blackhole_100ms_latency              | lost_bytes         | 9/10              |                                                                                                                                                                                                                                                                                                                                                             |
| ✅   | file_to_blackhole_0ms_latency                | lost_bytes         | 10/10             |                                                                                                                                                                                                                                                                                                                                                             |
| ✅   | file_to_blackhole_0ms_latency                | memory_usage       | 10/10             |                                                                                                                                                                                                                                                                                                                                                             |
| ✅   | file_to_blackhole_0ms_latency_http1          | lost_bytes         | 10/10             |                                                                                                                                                                                                                                                                                                                                                             |
| ✅   | file_to_blackhole_0ms_latency_http1          | memory_usage       | 10/10             |                                                                                                                                                                                                                                                                                                                                                             |
| ✅   | file_to_blackhole_0ms_latency_http2          | lost_bytes         | 10/10             |                                                                                                                                                                                                                                                                                                                                                             |
| ✅   | file_to_blackhole_0ms_latency_http2          | memory_usage       | 10/10             |                                                                                                                                                                                                                                                                                                                                                             |
| ✅   | file_to_blackhole_1000ms_latency             | memory_usage       | 10/10             |                                                                                                                                                                                                                                                                                                                                                             |
| ✅   | file_to_blackhole_1000ms_latency_linear_load | memory_usage       | 10/10             |                                                                                                                                                                                                                                                                                                                                                             |
| ✅   | file_to_blackhole_100ms_latency              | memory_usage       | 10/10             |                                                                                                                                                                                                                                                                                                                                                             |
| ✅   | file_to_blackhole_300ms_latency              | lost_bytes         | 10/10             |                                                                                                                                                                                                                                                                                                                                                             |
| ✅   | file_to_blackhole_300ms_latency              | memory_usage       | 10/10             |                                                                                                                                                                                                                                                                                                                                                             |
| ✅   | file_to_blackhole_500ms_latency              | lost_bytes         | 10/10             |                                                                                                                                                                                                                                                                                                                                                             |
| ✅   | file_to_blackhole_500ms_latency              | memory_usage       | 10/10             |                                                                                                                                                                                                                                                                                                                                                             |
| ✅   | quality_gate_idle                            | intake_connections | 10/10             | [bounds checks dashboard](https://app.datadoghq.com/dashboard/vz3-jd5-bdi?fromUser=true&refresh_mode=paused&tpl_var_experiment%5B0%5D=quality_gate_idle&tpl_var_job_id%5B0%5D=64eb7c4f-aad2-4418-a43a-a2b084acb5ba&tpl_var_run-id%5B0%5D=64eb7c4f-aad2-4418-a43a-a2b084acb5ba&view=spans&from_ts=1743007405000&to_ts=1743008005000&live=false)              |
| ✅   | quality_gate_idle                            | memory_usage       | 10/10             | [bounds checks dashboard](https://app.datadoghq.com/dashboard/vz3-jd5-bdi?fromUser=true&refresh_mode=paused&tpl_var_experiment%5B0%5D=quality_gate_idle&tpl_var_job_id%5B0%5D=64eb7c4f-aad2-4418-a43a-a2b084acb5ba&tpl_var_run-id%5B0%5D=64eb7c4f-aad2-4418-a43a-a2b084acb5ba&view=spans&from_ts=1743007405000&to_ts=1743008005000&live=false)              |
| ✅   | quality_gate_idle_all_features               | intake_connections | 10/10             | [bounds checks dashboard](https://app.datadoghq.com/dashboard/vz3-jd5-bdi?fromUser=true&refresh_mode=paused&tpl_var_experiment%5B0%5D=quality_gate_idle_all_features&tpl_var_job_id%5B0%5D=64eb7c4f-aad2-4418-a43a-a2b084acb5ba&tpl_var_run-id%5B0%5D=64eb7c4f-aad2-4418-a43a-a2b084acb5ba&view=spans&from_ts=1743007405000&to_ts=1743008005000&live=false) |
| ✅   | quality_gate_idle_all_features               | memory_usage       | 10/10             | [bounds checks dashboard](https://app.datadoghq.com/dashboard/vz3-jd5-bdi?fromUser=true&refresh_mode=paused&tpl_var_experiment%5B0%5D=quality_gate_idle_all_features&tpl_var_job_id%5B0%5D=64eb7c4f-aad2-4418-a43a-a2b084acb5ba&tpl_var_run-id%5B0%5D=64eb7c4f-aad2-4418-a43a-a2b084acb5ba&view=spans&from_ts=1743007405000&to_ts=1743008005000&live=false) |
| ✅   | quality_gate_logs                            | intake_connections | 10/10             |                                                                                                                                                                                                                                                                                                                                                             |
| ✅   | quality_gate_logs                            | lost_bytes         | 10/10             |                                                                                                                                                                                                                                                                                                                                                             |
| ✅   | quality_gate_logs                            | memory_usage       | 10/10             |                                                                                                                                                                                                                                                                                                                                                             |


<details>
<summary><h2>
Explanation
</h2></summary>

**Confidence level:** 90.00%
**Effect size tolerance:** |Δ mean %| ≥ 5.00%

Performance changes are noted in the **perf** column of each table:

* ✅ = significantly better comparison variant performance
* ❌ = significantly worse comparison variant performance
* ➖ = no significant change in performance

A regression test is an A/B test of target performance in a repeatable rig, where "performance" is measured as "comparison variant minus baseline variant" for an optimization goal (e.g., ingress throughput). Due to intrinsic variability in measuring that goal, we can only estimate its mean value for each experiment; we report uncertainty in that value as a 90.00% confidence interval denoted "Δ mean % CI".

For each experiment, we decide whether a change in performance is a "regression" -- a change worth investigating further -- if all of the following criteria are true:

1. Its estimated |Δ mean %| ≥ 5.00%, indicating the change is big enough to merit a closer look.

2. Its 90.00% confidence interval "Δ mean % CI" does not contain zero, indicating that *if our statistical model is accurate*, there is at least a 90.00% chance there is a difference in performance between baseline and comparison variants.

3. Its configuration does not mark it "erratic".
</details>

## CI Pass/Fail Decision

✅ **Passed.** All Quality Gates passed.

- **quality_gate_idle**, bounds check **intake_connections**: 10/10 replicas passed. Gate passed.
- **quality_gate_idle**, bounds check **memory_usage**: 10/10 replicas passed. Gate passed.
- **quality_gate_logs**, bounds check **memory_usage**: 10/10 replicas passed. Gate passed.
- **quality_gate_logs**, bounds check **lost_bytes**: 10/10 replicas passed. Gate passed.
- **quality_gate_logs**, bounds check **intake_connections**: 10/10 replicas passed. Gate passed.
- **quality_gate_idle_all_features**, bounds check **memory_usage**: 10/10 replicas passed. Gate passed.
- **quality_gate_idle_all_features**, bounds check **intake_connections**: 10/10 replicas passed. Gate passed.
author_association: NONE
user: login: agent-platform-auto-pr[bot]
created_at: 2025-03-26T12:12:58Z
body: ## Static quality checks ✅

Please find below the results from static quality gates


<details>
<summary>Successful checks</summary>

### Info

|Result|Quality gate|On disk size|On disk size limit|On wire size|On wire size limit|
|----|----|----|----|----|----|
|✅|static_quality_gate_agent_deb_amd64|781.38 MiB|781.68 MiB|190.73 MiB|191.21 MiB|
|✅|static_quality_gate_agent_deb_amd64_fips|779.36 MiB|779.64 MiB|190.13 MiB|190.66 MiB|
|✅|static_quality_gate_agent_rpm_amd64|781.37 MiB|781.68 MiB|193.19 MiB|193.7 MiB|
|✅|static_quality_gate_agent_rpm_amd64_fips|779.34 MiB|779.78 MiB|192.51 MiB|193.02 MiB|
|✅|static_quality_gate_agent_rpm_arm64|772.73 MiB|773.19 MiB|174.25 MiB|174.7 MiB|
|✅|static_quality_gate_agent_rpm_arm64_fips|770.93 MiB|771.33 MiB|173.39 MiB|173.92 MiB|
|✅|static_quality_gate_agent_suse_amd64|781.37 MiB|781.76 MiB|193.19 MiB|193.7 MiB|
|✅|static_quality_gate_agent_suse_arm64|772.72 MiB|773.22 MiB|174.25 MiB|174.7 MiB|
|✅|static_quality_gate_agent_suse_amd64_fips|779.35 MiB|779.77 MiB|192.51 MiB|193.02 MiB|
|✅|static_quality_gate_agent_suse_arm64_fips|770.93 MiB|771.34 MiB|173.39 MiB|173.92 MiB|
|✅|static_quality_gate_agent_msi|980.33 MiB|980.51 MiB|149.57 MiB|150.11 MiB|
|✅|static_quality_gate_agent_heroku_amd64|429.8 MiB|430.25 MiB|112.61 MiB|113.11 MiB|
|✅|static_quality_gate_dogstatsd_deb_amd64|37.73 MiB|38.23 MiB|9.78 MiB|10.28 MiB|
|✅|static_quality_gate_dogstatsd_deb_arm64|36.32 MiB|36.82 MiB|8.48 MiB|8.98 MiB|
|✅|static_quality_gate_dogstatsd_rpm_amd64|37.73 MiB|38.23 MiB|9.79 MiB|10.29 MiB|
|✅|static_quality_gate_dogstatsd_suse_amd64|37.73 MiB|38.23 MiB|9.79 MiB|10.29 MiB|
|✅|static_quality_gate_iot_agent_deb_amd64|58.34 MiB|58.84 MiB|14.74 MiB|15.24 MiB|
|✅|static_quality_gate_iot_agent_deb_arm64|55.76 MiB|56.26 MiB|12.72 MiB|13.23 MiB|
|✅|static_quality_gate_iot_agent_deb_armhf|54.43 MiB|54.93 MiB|12.73 MiB|13.23 MiB|
|✅|static_quality_gate_iot_agent_rpm_amd64|58.34 MiB|58.84 MiB|14.76 MiB|15.26 MiB|
|✅|static_quality_gate_iot_agent_rpm_arm64|55.76 MiB|56.26 MiB|12.75 MiB|13.25 MiB|
|✅|static_quality_gate_iot_agent_rpm_armhf|54.43 MiB|54.93 MiB|12.74 MiB|13.24 MiB|
|✅|static_quality_gate_iot_agent_suse_amd64|58.34 MiB|58.84 MiB|14.76 MiB|15.26 MiB|
|✅|static_quality_gate_docker_agent_amd64|865.9 MiB|866.39 MiB|291.34 MiB|291.84 MiB|
|✅|static_quality_gate_docker_agent_arm64|880.59 MiB|881.08 MiB|277.8 MiB|278.3 MiB|
|✅|static_quality_gate_docker_agent_jmx_amd64|865.9 MiB|866.39 MiB|291.34 MiB|291.84 MiB|
|✅|static_quality_gate_docker_agent_jmx_arm64|880.59 MiB|881.08 MiB|277.8 MiB|278.3 MiB|
|✅|static_quality_gate_docker_agent_windows1809|865.9 MiB|866.39 MiB|291.34 MiB|291.84 MiB|
|✅|static_quality_gate_docker_agent_windows1809_core|865.9 MiB|866.39 MiB|291.34 MiB|291.84 MiB|
|✅|static_quality_gate_docker_agent_windows1809_core_jmx|865.9 MiB|866.39 MiB|291.34 MiB|291.84 MiB|
|✅|static_quality_gate_docker_agent_windows1809_jmx|865.9 MiB|866.39 MiB|291.34 MiB|291.84 MiB|
|✅|static_quality_gate_docker_agent_windows2022|865.9 MiB|866.39 MiB|291.34 MiB|291.84 MiB|
|✅|static_quality_gate_docker_agent_windows2022_core|865.9 MiB|866.39 MiB|291.34 MiB|291.84 MiB|
|✅|static_quality_gate_docker_agent_windows2022_core_jmx|865.9 MiB|866.39 MiB|291.34 MiB|291.84 MiB|
|✅|static_quality_gate_docker_agent_windows2022_jmx|865.9 MiB|866.39 MiB|291.34 MiB|291.84 MiB|
|✅|static_quality_gate_docker_dogstatsd_amd64|45.87 MiB|46.37 MiB|17.3 MiB|17.8 MiB|
|✅|static_quality_gate_docker_dogstatsd_arm64|44.49 MiB|44.99 MiB|16.16 MiB|16.66 MiB|
|✅|static_quality_gate_docker_cluster_agent_amd64|262.87 MiB|263.29 MiB|105.56 MiB|106.03 MiB|
|✅|static_quality_gate_docker_cluster_agent_arm64|278.83 MiB|279.25 MiB|100.42 MiB|100.87 MiB|
|✅|static_quality_gate_docker_cws_instrumentation_amd64|6.65 MiB|7.15 MiB|2.82 MiB|3.32 MiB|
|✅|static_quality_gate_docker_cws_instrumentation_arm64|6.44 MiB|6.94 MiB|2.6 MiB|3.1 MiB|

</details>

author_association: CONTRIBUTOR
user: login: agent-platform-auto-pr[bot]
created_at: 2025-03-26T13:47:55Z
body: ## Static quality checks ❌

Please find below the results from static quality gates
### Error

|Result|Quality gate|On disk size|On disk size limit|On wire size|On wire size limit|
|----|----|----|----|----|----|
|❌|static_quality_gate_agent_suse_arm64|DataNotFound|773.22 MiB|DataNotFound|174.7 MiB|
<details>
<summary>Gate failure full details</summary>

|Quality gate|Error type|Error message|
|----|---|--------|
|static_quality_gate_agent_suse_arm64|StackTrace|Traceback (most recent call last):<br>  File "/go/src/github.com/DataDog/datadog-agent/tasks/quality_gates.py", line 125, in parse_and_trigger_gates<br>    gate_mod.entrypoint(**gate_inputs)<br>  File "/go/src/github.com/DataDog/datadog-agent/tasks/static_quality_gates/static_quality_gate_agent_suse_arm64.py", line 5, in entrypoint<br>    generic_package_agent_quality_gate(<br>  File "/go/src/github.com/DataDog/datadog-agent/tasks/static_quality_gates/lib/package_agent_lib.py", line 75, in generic_package_agent_quality_gate<br>    package_on_wire_size, package_on_disk_size = calculate_package_size(<br>                                                 ^^^^^^^^^^^^^^^^^^^^^^^<br>  File "/go/src/github.com/DataDog/datadog-agent/tasks/static_quality_gates/lib/package_agent_lib.py", line 10, in calculate_package_size<br>    extract_package(ctx=ctx, package_os=package_os, package_path=package_path, extract_dir=extract_dir)<br>  File "/go/src/github.com/DataDog/datadog-agent/tasks/libs/package/size.py", line 92, in extract_package<br>    return extract_rpm_package(ctx, package_path, extract_dir)<br>           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^<br>  File "/go/src/github.com/DataDog/datadog-agent/tasks/libs/package/size.py", line 68, in extract_rpm_package<br>    ctx.run(f"rpm2cpio {package_path} | cpio -idm > /dev/null")<br>  File "/.pyenv/versions/3.12.6/lib/python3.12/site-packages/invoke/context.py", line 104, in run<br>    return self._run(runner, command, **kwargs)<br>           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^<br>  File "/.pyenv/versions/3.12.6/lib/python3.12/site-packages/invoke/context.py", line 113, in _run<br>    return runner.run(command, **kwargs)<br>           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^<br>  File "/.pyenv/versions/3.12.6/lib/python3.12/site-packages/invoke/runners.py", line 395, in run<br>    return self._run_body(command, **kwargs)<br>           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^<br>  File "/.pyenv/versions/3.12.6/lib/python3.12/site-packages/invoke/runners.py", line 451, in _run_body<br>    return self.make_promise() if self._asynchronous else self._finish()<br>                                                          ^^^^^^^^^^^^^^<br>  File "/.pyenv/versions/3.12.6/lib/python3.12/site-packages/invoke/runners.py", line 518, in _finish<br>    raise UnexpectedExit(result)<br>invoke.exceptions.UnexpectedExit: Encountered a bad command exit code!<br><br>Command: 'cd /tmp/tmpmo_pm_up && rpm2cpio /go/src/github.com/DataDog/datadog-agent/omnibus/pkg/datadog-agent-7.66.0~devel.git.103.2d9a7a2.pipeline.60021705-1.aarch64.rpm | cpio -idm > /dev/null'<br><br>Exit code: 2<br><br>Stdout: already printed<br><br>Stderr: already printed<br><br><br>|

</details>

Static quality gates prevent the PR to merge! You can check the static quality gates [confluence page](https://datadoghq.atlassian.net/wiki/spaces/agent/pages/4805854687/Static+Quality+Gates) for guidance. We also have a [toolbox page](https://datadoghq.atlassian.net/wiki/spaces/agent/pages/4887448722/Static+Quality+Gates+Toolbox) available to list tools useful to debug the size increase.


<details>
<summary>Successful checks</summary>

### Info

|Result|Quality gate|On disk size|On disk size limit|On wire size|On wire size limit|
|----|----|----|----|----|----|
|✅|static_quality_gate_agent_deb_amd64|781.35 MiB|781.68 MiB|190.71 MiB|191.21 MiB|
|✅|static_quality_gate_agent_deb_arm64|772.74 MiB|773.21 MiB|172.91 MiB|173.2 MiB|
|✅|static_quality_gate_agent_deb_amd64_fips|779.35 MiB|779.64 MiB|190.16 MiB|190.66 MiB|
|✅|static_quality_gate_agent_deb_arm64_fips|770.94 MiB|771.22 MiB|170.82 MiB|172.07 MiB|
|✅|static_quality_gate_agent_rpm_amd64|781.35 MiB|781.68 MiB|193.21 MiB|193.7 MiB|
|✅|static_quality_gate_agent_rpm_amd64_fips|779.34 MiB|779.78 MiB|192.54 MiB|193.02 MiB|
|✅|static_quality_gate_agent_rpm_arm64|772.76 MiB|773.19 MiB|174.17 MiB|174.7 MiB|
|✅|static_quality_gate_agent_rpm_arm64_fips|770.91 MiB|771.33 MiB|173.39 MiB|173.92 MiB|
|✅|static_quality_gate_agent_suse_amd64|781.35 MiB|781.76 MiB|193.21 MiB|193.7 MiB|
|✅|static_quality_gate_agent_suse_amd64_fips|779.27 MiB|779.77 MiB|192.54 MiB|193.02 MiB|
|✅|static_quality_gate_agent_suse_arm64_fips|770.93 MiB|771.34 MiB|173.39 MiB|173.92 MiB|
|✅|static_quality_gate_agent_msi|980.35 MiB|980.51 MiB|149.58 MiB|150.11 MiB|
|✅|static_quality_gate_agent_heroku_amd64|429.81 MiB|430.25 MiB|112.61 MiB|113.11 MiB|
|✅|static_quality_gate_dogstatsd_deb_amd64|37.73 MiB|38.23 MiB|9.78 MiB|10.28 MiB|
|✅|static_quality_gate_dogstatsd_deb_arm64|36.32 MiB|36.82 MiB|8.48 MiB|8.98 MiB|
|✅|static_quality_gate_dogstatsd_rpm_amd64|37.73 MiB|38.23 MiB|9.79 MiB|10.29 MiB|
|✅|static_quality_gate_dogstatsd_suse_amd64|37.73 MiB|38.23 MiB|9.79 MiB|10.29 MiB|
|✅|static_quality_gate_iot_agent_deb_amd64|58.34 MiB|58.84 MiB|14.73 MiB|15.24 MiB|
|✅|static_quality_gate_iot_agent_deb_arm64|55.76 MiB|56.26 MiB|12.73 MiB|13.23 MiB|
|✅|static_quality_gate_iot_agent_deb_armhf|54.43 MiB|54.93 MiB|12.73 MiB|13.23 MiB|
|✅|static_quality_gate_iot_agent_rpm_amd64|58.34 MiB|58.84 MiB|14.75 MiB|15.26 MiB|
|✅|static_quality_gate_iot_agent_rpm_arm64|55.76 MiB|56.26 MiB|12.75 MiB|13.25 MiB|
|✅|static_quality_gate_iot_agent_rpm_armhf|54.43 MiB|54.93 MiB|12.74 MiB|13.24 MiB|
|✅|static_quality_gate_iot_agent_suse_amd64|58.34 MiB|58.84 MiB|14.75 MiB|15.26 MiB|
|✅|static_quality_gate_docker_agent_amd64|865.89 MiB|866.39 MiB|291.35 MiB|291.84 MiB|
|✅|static_quality_gate_docker_agent_arm64|880.58 MiB|881.08 MiB|277.8 MiB|278.3 MiB|
|✅|static_quality_gate_docker_agent_jmx_amd64|865.89 MiB|866.39 MiB|291.35 MiB|291.84 MiB|
|✅|static_quality_gate_docker_agent_jmx_arm64|880.58 MiB|881.08 MiB|277.8 MiB|278.3 MiB|
|✅|static_quality_gate_docker_agent_windows1809|865.89 MiB|866.39 MiB|291.35 MiB|291.84 MiB|
|✅|static_quality_gate_docker_agent_windows1809_core|865.89 MiB|866.39 MiB|291.35 MiB|291.84 MiB|
|✅|static_quality_gate_docker_agent_windows1809_core_jmx|865.89 MiB|866.39 MiB|291.35 MiB|291.84 MiB|
|✅|static_quality_gate_docker_agent_windows1809_jmx|865.89 MiB|866.39 MiB|291.35 MiB|291.84 MiB|
|✅|static_quality_gate_docker_agent_windows2022|865.89 MiB|866.39 MiB|291.35 MiB|291.84 MiB|
|✅|static_quality_gate_docker_agent_windows2022_core|865.89 MiB|866.39 MiB|291.35 MiB|291.84 MiB|
|✅|static_quality_gate_docker_agent_windows2022_core_jmx|865.89 MiB|866.39 MiB|291.35 MiB|291.84 MiB|
|✅|static_quality_gate_docker_agent_windows2022_jmx|865.89 MiB|866.39 MiB|291.35 MiB|291.84 MiB|
|✅|static_quality_gate_docker_dogstatsd_amd64|45.87 MiB|46.37 MiB|17.3 MiB|17.8 MiB|
|✅|static_quality_gate_docker_dogstatsd_arm64|44.49 MiB|44.99 MiB|16.16 MiB|16.66 MiB|
|✅|static_quality_gate_docker_cluster_agent_amd64|262.79 MiB|263.29 MiB|105.53 MiB|106.03 MiB|
|✅|static_quality_gate_docker_cluster_agent_arm64|278.75 MiB|279.25 MiB|100.37 MiB|100.87 MiB|
|✅|static_quality_gate_docker_cws_instrumentation_amd64|6.65 MiB|7.15 MiB|2.82 MiB|3.32 MiB|
|✅|static_quality_gate_docker_cws_instrumentation_arm64|6.44 MiB|6.94 MiB|2.6 MiB|3.1 MiB|

</details>

author_association: CONTRIBUTOR
user: login: val06
created_at: 2025-03-26T18:06:45Z
body: /merge
author_association: CONTRIBUTOR
user: login: dd-devflow[bot]
created_at: 2025-03-26T18:06:50Z
body: <!-- "FeedbackWorkflowId":"95b2db92-970e-4ec7-982f-3502cc081599_36" -->
[View all feedbacks in Devflow UI.](https://devflow.static-app.us1.prod.dog/logs/95b2db92-970e-4ec7-982f-3502cc081599_36)
`2025-03-26 18:06:49 UTC` :information_source: Start processing command `/merge`

---
`2025-03-26 18:06:56 UTC` :information_source: **MergeQueue:** pull request added to the queue

The expected merge time in `main` is approximately 54m (p90).

---
`2025-03-26 18:35:11 UTC` :information_source: **MergeQueue:** This merge request was merged

author_association: NONE