|
|
@ -30,7 +30,6 @@ var ( |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
type filesystemCollector struct { |
|
|
|
type filesystemCollector struct { |
|
|
|
config Config |
|
|
|
|
|
|
|
ignoredMountPointsPattern *regexp.Regexp |
|
|
|
ignoredMountPointsPattern *regexp.Regexp |
|
|
|
|
|
|
|
|
|
|
|
size, free, avail, files, filesFree *prometheus.GaugeVec |
|
|
|
size, free, avail, files, filesFree *prometheus.GaugeVec |
|
|
@ -40,13 +39,11 @@ func init() { |
|
|
|
Factories["filesystem"] = NewFilesystemCollector |
|
|
|
Factories["filesystem"] = NewFilesystemCollector |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Takes a config struct and prometheus registry and returns a new Collector exposing
|
|
|
|
// filesystems stats.
|
|
|
|
// network device filesystems.
|
|
|
|
func NewFilesystemCollector() (Collector, error) { |
|
|
|
func NewFilesystemCollector(config Config) (Collector, error) { |
|
|
|
|
|
|
|
var filesystemLabelNames = []string{"filesystem"} |
|
|
|
var filesystemLabelNames = []string{"filesystem"} |
|
|
|
|
|
|
|
|
|
|
|
return &filesystemCollector{ |
|
|
|
return &filesystemCollector{ |
|
|
|
config: config, |
|
|
|
|
|
|
|
ignoredMountPointsPattern: regexp.MustCompile(*ignoredMountPoints), |
|
|
|
ignoredMountPointsPattern: regexp.MustCompile(*ignoredMountPoints), |
|
|
|
size: prometheus.NewGaugeVec( |
|
|
|
size: prometheus.NewGaugeVec( |
|
|
|
prometheus.GaugeOpts{ |
|
|
|
prometheus.GaugeOpts{ |
|
|
|