diff options
author | Matthias Rampke <matthias@rampke.de> | 2015-09-26 14:53:46 +0200 |
---|---|---|
committer | Matthias Rampke <matthias@rampke.de> | 2015-09-26 15:32:10 +0200 |
commit | 20b551ab2bd8980c82fb6802296fc26cabc90de4 (patch) | |
tree | b49f7fcdf40276cc1d54ee47c2259f0d75ffff27 /collector/filesystem_linux.go | |
parent | cf3aa37f1a7a28d07f5ac07eea388d67e9785bfa (diff) | |
download | prometheus_node_collector-20b551ab2bd8980c82fb6802296fc26cabc90de4.tar.bz2 prometheus_node_collector-20b551ab2bd8980c82fb6802296fc26cabc90de4.tar.xz prometheus_node_collector-20b551ab2bd8980c82fb6802296fc26cabc90de4.zip |
Add flag to change the location of the procfs.
Remove all hardcoded references to `/proc`. For all collectors that do
not use `github.com/prometheus/procfs` yet, provide a wrapper to
generate the full paths.
Reformulate help strings, errors and comments to remove absolute
references to `/proc`.
This is a breaking change: the `-collector.ipvs.procfs` flag is removed
in favor of the general flag. Since it only affected that collector it
was only useful for development, so this should not cause many issues.
Diffstat (limited to 'collector/filesystem_linux.go')
-rw-r--r-- | collector/filesystem_linux.go | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/collector/filesystem_linux.go b/collector/filesystem_linux.go index 6090b2d..22e4998 100644 --- a/collector/filesystem_linux.go +++ b/collector/filesystem_linux.go | |||
@@ -14,7 +14,6 @@ import ( | |||
14 | 14 | ||
15 | const ( | 15 | const ( |
16 | defIgnoredMountPoints = "^/(sys|proc|dev)($|/)" | 16 | defIgnoredMountPoints = "^/(sys|proc|dev)($|/)" |
17 | procMounts = "/proc/mounts" | ||
18 | ) | 17 | ) |
19 | 18 | ||
20 | var ( | 19 | var ( |
@@ -60,7 +59,7 @@ func (c *filesystemCollector) GetStats() (stats []filesystemStats, err error) { | |||
60 | } | 59 | } |
61 | 60 | ||
62 | func mountPointDetails() ([]filesystemDetails, error) { | 61 | func mountPointDetails() ([]filesystemDetails, error) { |
63 | file, err := os.Open(procMounts) | 62 | file, err := os.Open(procFilePath("mounts")) |
64 | if err != nil { | 63 | if err != nil { |
65 | return nil, err | 64 | return nil, err |
66 | } | 65 | } |