Fix mount points being collected multiple times in filesystem_linux (#3376)

Signed-off-by: Markus Sütter <markus.suetter@secunet.com>
pull/3453/head
Markus 2 months ago committed by GitHub
parent ead70c7ae4
commit ef5efb707b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 6
      collector/filesystem_linux.go

@ -128,6 +128,12 @@ func (c *filesystemCollector) processStat(labels filesystemLabels) filesystemSta
}
stuckMountsMtx.Unlock()
// Remove options from labels because options will not be used from this point forward
// and keeping them can lead to errors when the same device is mounted to the same mountpoint
// twice, with different options (metrics would be recorded multiple times).
labels.mountOptions = ""
labels.superOptions = ""
if err != nil {
labels.deviceError = err.Error()
c.logger.Debug("Error on statfs() system call", "rootfs", rootfsFilePath(labels.mountPoint), "err", err)

Loading…
Cancel
Save