mirror of
https://github.com/prometheus-community/windows_exporter.git
synced 2026-03-02 16:46:35 +00:00
Merge pull request #2 from carlpett/f-disk-exclude-_total
Perf: Make exclusion of _Total label hardcoded
This commit is contained in:
@@ -15,7 +15,7 @@ import (
|
|||||||
|
|
||||||
var (
|
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.")
|
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
|
// A PerfCollector is a Prometheus collector for WMI Win32_PerfRawData_PerfDisk_LogicalDisk metrics
|
||||||
@@ -401,7 +401,9 @@ func (c *PerfCollector) collect(ch chan<- prometheus.Metric) (*prometheus.Desc,
|
|||||||
}
|
}
|
||||||
|
|
||||||
for _, volume := range dst {
|
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
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user