feat: add agent deployment documentation and improve disk telemetry filtering in deploy script
This commit is contained in:
@@ -184,13 +184,28 @@ def collect_and_send_telemetry():
|
||||
|
||||
linux_labels = get_linux_labels() if os.name != "nt" else {}
|
||||
disks = []
|
||||
seen_devices = set() # Deduplicate: skip bind-mounts that reuse the same device
|
||||
for part in psutil.disk_partitions(all=False):
|
||||
# Skip loop devices and unknown/empty fstypes
|
||||
if 'loop' in part.device or 'loop' in part.fstype or part.fstype == '':
|
||||
continue
|
||||
# Skip snap & squashfs mounts
|
||||
if part.mountpoint.startswith('/snap') or part.fstype == 'squashfs':
|
||||
continue
|
||||
# Skip boot, WSL internal, and other virtual/system paths
|
||||
if part.mountpoint.startswith('/boot') or part.mountpoint.startswith('/mnt/wsl'):
|
||||
continue
|
||||
if part.mountpoint.startswith('/var/snap') or part.mountpoint.startswith('/run'):
|
||||
continue
|
||||
# Skip virtual/overlay filesystems
|
||||
if part.fstype in ('tmpfs', 'devtmpfs', 'overlay', 'aufs', 'fusectl',
|
||||
'proc', 'sysfs', 'cgroup', 'cgroup2', 'pstore',
|
||||
'securityfs', 'debugfs', 'tracefs', 'bpf'):
|
||||
continue
|
||||
# Deduplicate: each physical device reported only once (eliminates bind-mounts)
|
||||
if part.device in seen_devices:
|
||||
continue
|
||||
seen_devices.add(part.device)
|
||||
try:
|
||||
usage = psutil.disk_usage(part.mountpoint)
|
||||
|
||||
@@ -202,7 +217,8 @@ def collect_and_send_telemetry():
|
||||
if part.mountpoint == "C:\\":
|
||||
label = "OS"
|
||||
else:
|
||||
label = f"Local Disk ({part.mountpoint.strip('\\')})"
|
||||
_mp = part.mountpoint.strip('\\')
|
||||
label = f"Local Disk ({_mp})"
|
||||
else:
|
||||
label = linux_labels.get(part.device, "")
|
||||
if not label:
|
||||
|
||||
Reference in New Issue
Block a user