Skip to content

Commit

Permalink
feat(exporter/windows): update unit test + integration doc
Browse files Browse the repository at this point in the history
Signed-off-by: hainenber <[email protected]>
  • Loading branch information
hainenber committed Dec 6, 2023
1 parent 9565147 commit 24fd918
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
9 changes: 9 additions & 0 deletions component/prometheus/exporter/windows/windows_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ var (
service {
where_clause = "where"
}
physical_disk {
include = ".+"
exclude = ""
}
process {
include = ".+"
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,16 @@ Full reference of options:
# Maps to collector.service.services-where in windows_exporter
[where_clause: <string> | 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: <string> | 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: <string> | default=".+"]

# Configuration for Windows Processes
process:
# Regexp of processes to include. Process name must both match whitelist and not match blacklist to be included.
Expand Down

0 comments on commit 24fd918

Please sign in to comment.