diff --git a/component/prometheus/exporter/windows/config_default_windows_test.go b/component/prometheus/exporter/windows/config_default_windows_test.go index 9fddd1d635eb..7242ac42e525 100644 --- a/component/prometheus/exporter/windows/config_default_windows_test.go +++ b/component/prometheus/exporter/windows/config_default_windows_test.go @@ -25,6 +25,8 @@ func TestRiverUnmarshalWithDefaultConfig(t *testing.T) { require.Equal(t, DefaultArguments.MSSQL.EnabledClasses, args.MSSQL.EnabledClasses) require.Equal(t, DefaultArguments.Network.Exclude, args.Network.Exclude) require.Equal(t, DefaultArguments.Network.Include, args.Network.Include) + require.Equal(t, DefaultArguments.PhysicalDisk.Exclude, args.PhysicalDisk.Exclude) + require.Equal(t, DefaultArguments.PhysicalDisk.Include, args.PhysicalDisk.Include) require.Equal(t, DefaultArguments.Process.Exclude, args.Process.Exclude) require.Equal(t, DefaultArguments.Process.Include, args.Process.Include) require.Equal(t, DefaultArguments.ScheduledTask.Exclude, args.ScheduledTask.Exclude) diff --git a/component/prometheus/exporter/windows/windows_test.go b/component/prometheus/exporter/windows/windows_test.go index 8b34164f5d7c..6f15ad6e7555 100644 --- a/component/prometheus/exporter/windows/windows_test.go +++ b/component/prometheus/exporter/windows/windows_test.go @@ -34,6 +34,11 @@ var ( service { where_clause = "where" } + + physical_disk { + include = ".+" + exclude = "" + } process { include = ".+" @@ -75,6 +80,8 @@ func TestRiverUnmarshal(t *testing.T) { require.Equal(t, "", args.SMTP.Exclude) require.Equal(t, ".+", args.SMTP.Include) require.Equal(t, "where", args.Service.Where) + require.Equal(t, "", args.PhysicalDisk.Exclude) + require.Equal(t, ".+", args.PhysicalDisk.Include) require.Equal(t, "", args.Process.Exclude) require.Equal(t, ".+", args.Process.Include) require.Equal(t, "", args.Network.Exclude) @@ -102,6 +109,8 @@ func TestConvert(t *testing.T) { require.Equal(t, "", conf.SMTP.Exclude) require.Equal(t, ".+", conf.SMTP.Include) require.Equal(t, "where", conf.Service.Where) + require.Equal(t, "", conf.PhysicalDisk.Exclude) + require.Equal(t, ".+", conf.PhysicalDisk.Include) require.Equal(t, "", conf.Process.Exclude) require.Equal(t, ".+", conf.Process.Include) require.Equal(t, "", conf.Network.Exclude) diff --git a/docs/sources/static/configuration/integrations/windows-exporter-config.md b/docs/sources/static/configuration/integrations/windows-exporter-config.md index 53c58b60fe0b..4d45e30acafe 100644 --- a/docs/sources/static/configuration/integrations/windows-exporter-config.md +++ b/docs/sources/static/configuration/integrations/windows-exporter-config.md @@ -114,6 +114,16 @@ Full reference of options: # Maps to collector.service.services-where in windows_exporter [where_clause: | default=""] + # Configuration for physical disk on Windows + physical_disk: + # Regexp of volumes to include. Disk name must both match include and not match exclude to be included. + # Maps to collector.logical_disk.disk-include in windows_exporter + [include: | default=".+"] + + # Regexp of volumes to exclude. Disk name must both match include and not match exclude to be included. + # Maps to collector.logical_disk.disk-exclude in windows_exporter + [exclude: | default=".+"] + # Configuration for Windows Processes process: # Regexp of processes to include. Process name must both match whitelist and not match blacklist to be included.