Skip to content

Commit

Permalink
Merge pull request #2 from carlpett/f-disk-exclude-_total
Browse files Browse the repository at this point in the history
Perf: Make exclusion of _Total label hardcoded
  • Loading branch information
martinlindhe authored Aug 27, 2016
2 parents 5e781b6 + 7f09738 commit 4165d75
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions collectors/perf.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (

var (
volumeWhitelist = flag.String("collector.perf.volume-whitelist", ".+", "Regexp of volumes to whitelist. Volume name must both match whitelist and not match blacklist to be included.")
volumeBlacklist = flag.String("collector.perf.volume-blacklist", "_Total", "Regexp of volumes to blacklist. Volume name must both match whitelist and not match blacklist to be included.")
volumeBlacklist = flag.String("collector.perf.volume-blacklist", "", "Regexp of volumes to blacklist. Volume name must both match whitelist and not match blacklist to be included.")
)

// A PerfCollector is a Prometheus collector for WMI Win32_PerfRawData_PerfDisk_LogicalDisk metrics
Expand Down Expand Up @@ -401,7 +401,9 @@ func (c *PerfCollector) collect(ch chan<- prometheus.Metric) (*prometheus.Desc,
}

for _, volume := range dst {
if c.volumeBlacklistPattern.MatchString(volume.Name) || !c.volumeWhitelistPattern.MatchString(volume.Name) {
if volume.Name == "_Total" ||
c.volumeBlacklistPattern.MatchString(volume.Name) ||
!c.volumeWhitelistPattern.MatchString(volume.Name) {
continue
}

Expand Down

0 comments on commit 4165d75

Please sign in to comment.