From 71df7fb58390b621882cacacf2df4f189291d57e Mon Sep 17 00:00:00 2001 From: Hoin <5130542+insevens@user.noreply.gitee.com> Date: Sat, 31 Jan 2026 11:04:43 +0800 Subject: [PATCH] =?UTF-8?q?fix(agent):=20=E6=8E=92=E9=99=A4=20tap=20?= =?UTF-8?q?=E5=BC=80=E5=A4=B4=E7=9A=84=E8=99=9A=E6=8B=9F=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E4=BB=A5=E9=81=BF=E5=85=8D=E8=AF=AF=E9=87=87=E9=9B=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在默认网络接口排除规则和示例配置中添加对 tap 开头接口的排除,这些是 PVE/KVM 虚拟机使用的虚拟网卡,不应纳入网络指标采集范围。 --- cmd/agent/agent.example.yaml | 1 + pkg/agent/config/config.go | 1 + 2 files changed, 2 insertions(+) diff --git a/cmd/agent/agent.example.yaml b/cmd/agent/agent.example.yaml index c959348..d12c478 100644 --- a/cmd/agent/agent.example.yaml +++ b/cmd/agent/agent.example.yaml @@ -51,6 +51,7 @@ collector: - "^docker.*" # 排除所有 docker 开头的接口 - "^veth.*" # 排除所有 veth 开头的虚拟接口 - "^br-.*" # 排除所有 br- 开头的网桥接口 + - "^tap.*" # 排除所有 tap 开头的接口(PVE/KVM 虚拟机) # 磁盘采集包含的挂载点列表(白名单) # 如果为空,默认采集系统主分区(Linux/macOS: "/",Windows: "C:\") diff --git a/pkg/agent/config/config.go b/pkg/agent/config/config.go index d75bd93..1bbac39 100644 --- a/pkg/agent/config/config.go +++ b/pkg/agent/config/config.go @@ -299,6 +299,7 @@ func DefaultNetworkExcludePatterns() []string { "^virbr.*", // KVM/libvirt 网桥 "^flannel.*", // Kubernetes Flannel "^cni.*", // Container Network Interface + "^tap.*", // PVE/KVM 虚拟机 TAP 网卡 // macOS 虚拟接口 "^anpi\\d+$", // Apple Network Process Interface "^ap\\d+$", // Apple Wireless Access Point