diff options
Diffstat (limited to 'collector/filesystem_linux.go')
-rw-r--r-- | collector/filesystem_linux.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/collector/filesystem_linux.go b/collector/filesystem_linux.go index e83b27a..00a7323 100644 --- a/collector/filesystem_linux.go +++ b/collector/filesystem_linux.go | |||
@@ -17,6 +17,7 @@ package collector | |||
17 | 17 | ||
18 | import ( | 18 | import ( |
19 | "bufio" | 19 | "bufio" |
20 | "errors" | ||
20 | "fmt" | 21 | "fmt" |
21 | "io" | 22 | "io" |
22 | "os" | 23 | "os" |
@@ -139,7 +140,7 @@ func stuckMountWatcher(mountPoint string, success chan struct{}, logger log.Logg | |||
139 | 140 | ||
140 | func mountPointDetails(logger log.Logger) ([]filesystemLabels, error) { | 141 | func mountPointDetails(logger log.Logger) ([]filesystemLabels, error) { |
141 | file, err := os.Open(procFilePath("1/mounts")) | 142 | file, err := os.Open(procFilePath("1/mounts")) |
142 | if os.IsNotExist(err) { | 143 | if errors.Is(err, os.ErrNotExist) { |
143 | // Fallback to `/proc/mounts` if `/proc/1/mounts` is missing due hidepid. | 144 | // Fallback to `/proc/mounts` if `/proc/1/mounts` is missing due hidepid. |
144 | level.Debug(logger).Log("msg", "Reading root mounts failed, falling back to system mounts", "err", err) | 145 | level.Debug(logger).Log("msg", "Reading root mounts failed, falling back to system mounts", "err", err) |
145 | file, err = os.Open(procFilePath("mounts")) | 146 | file, err = os.Open(procFilePath("mounts")) |