Skip to content

Commit d296b78

Browse files
author
dushixiang
committed
修复Windows环境下磁盘采集的默认配置
1 parent ae089e9 commit d296b78

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

cmd/agent/agent.example.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ collector:
5050
# 如果为空,默认采集系统主分区(Linux/macOS: "/",Windows: "C:\")
5151
# 例如:
5252
# Linux/macOS: ["/", "/data", "/home"]
53-
# Windows: ["C:\\", "D:\\"]
53+
# Windows: ["C:", "D:"]
5454
disk_include:
5555
- "/" # 只采集根分区
5656

pkg/agent/config/config.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ type CollectorConfig struct {
7070
// 如果为空,默认采集系统主分区(Linux/macOS: "/",Windows: "C:\")
7171
// 例如:
7272
// Linux/macOS: ["/", "/data", "/home"]
73-
// Windows: ["C:\\", "D:\\"]
73+
// Windows: ["C:", "D:"]
7474
DiskInclude []string `yaml:"disk_include"`
7575
}
7676

@@ -372,11 +372,11 @@ func (c *Config) ShouldExcludeNetworkInterface(interfaceName string) bool {
372372
// GetDiskInclude 获取磁盘包含的挂载点列表(白名单)
373373
// 如果配置为空,返回默认的根分区匹配规则
374374
// Linux/macOS: ["/"]
375-
// Windows: ["C:\\"]
375+
// Windows: ["C:"]
376376
func (c *Config) GetDiskInclude() []string {
377377
if len(c.Collector.DiskInclude) == 0 {
378378
if runtime.GOOS == "windows" {
379-
return []string{"C:\\"}
379+
return []string{"C:"}
380380
}
381381
return []string{"/"}
382382
}

0 commit comments

Comments
 (0)