Commit Graph

21 Commits

Author SHA1 Message Date
Brandon Gilmore 76bbd8dd18 Use /proc/mounts instead of statfs(2) for ro state (#1002)
While the statfs(2) approach is reliable for normally mounted filesystems, the
flags returned can be inconsistent when filesystem has been remounted read-only
after encountering an error. The returned flags do accurately represent the
internal state of the filesystem, but they do not reflect whether the VFS layer
will accept writes. Instead, it makes sense to parse the current VFS mount
state from the options field in /proc/mounts since it takes precedence.

Signed-off-by: Brandon Gilmore <bgilmore@valvesoftware.com>
2018-07-16 15:56:27 +02:00
Brian Brazil a98067a294 Make metrics better follow guidelines (#787)
* Improve stat linux metric names.

cpu is no longer used.

* node_cpu -> node_cpu_seconds_total for Linux

* Improve filesystem metric names with units

* Improve units and names of linux disk stats

Remove sector metrics, the bytes metrics cover those already.

* Infiniband counters should end in _total

* Improve timex metric names, convert to more normal units.

See
3c073991eb/kernel/time/ntp.c (L909)
for what stabil means, looks like a moving average of some form.

* Update test fixture

* For meminfo metrics that had "kB" units, add _bytes

* Interrupts counter should have _total
2018-01-17 17:55:55 +01:00
Calle Pettersson 859a825bb8 Replace --collectors.enabled with per-collector flags (#640)
* Move NodeCollector into package collector

* Refactor collector enabling

* Update README with new collector enabled flags

* Fix out-of-date inline flag reference syntax

* Use new flags in end-to-end tests

* Add flag to disable all default collectors

* Track if a flag has been set explicitly

* Add --collectors.disable-defaults to README

* Revert disable-defaults flag

* Shorten flags

* Fixup timex collector registration

* Fix end-to-end tests

* Change procfs and sysfs path flags

* Fix review comments
2017-09-28 15:06:26 +02:00
Calle Pettersson dfe07eaae8 Switch to kingpin flags (#639)
* Switch to kingpin flags

* Fix logrus vendoring

* Fix flags in main tests

* Fix vendoring versions
2017-08-12 15:07:24 +02:00
Jonas Große Sundrup e6d031788f Correct typo (#582) 2017-05-14 19:46:23 +02:00
Tobias Schmidt d290ea94b8 Fix export of stale device error metrics for unmounted filesystems
Instead of maintaining a counter metric for device errors in memory,
this change exports a gauge and uses const metrics to avoid leaking
metrics for unmounted filesystems.
2017-03-22 21:48:18 -03:00
Tobias Schmidt 922e74d58f Remove unnecessarily named return variables
Named return variables should only be used to describe the returned type
further, e.g. `err error` doesn't add any new information and is just
stutter.
2017-02-28 16:04:25 -04:00
Tobias Schmidt c703435790 Fix all open go lint and vet issues 2017-02-28 13:05:38 -04:00
Johannes 'fish' Ziemke 4c9131b7d8 Make sure we only return one metric per mounted fs 2017-01-04 16:45:25 +01:00
Johannes 'fish' Ziemke deebf0aa49 Add node_filesystem_device_errors_total metric
This metric is the total number of errors occurred when getting stats
for the given device.
2016-12-19 11:48:32 +01:00
stuart nelson 61f36ac1ab Activate filesystem collector on DragonFly (#302) 2016-09-11 12:08:00 -04:00
Johannes 'fish' Ziemke 4b04d04558 Enable *bsd collector on darwin 2016-07-06 10:24:20 +02:00
Sharif Nassar f0630d5cbb Do not export the filesystem type pattern 2016-06-06 11:10:50 -07:00
Sharif Nassar bf88b6ee0f Fix typos, and initialisms from comments in #217 2016-05-13 13:40:14 -07:00
Dominik Schulz 3fe5e7f8fa Add ignored fs types 2016-05-13 13:40:14 -07:00
Will Rouesnel 05539ee156 Add filesystem read-only metric node_filesystem_readonly
This is a boolean metric which is set to 1 when the filesystem is flagged as
read-only.
2015-11-12 14:11:07 +11:00
Nick Owens ebf3ef32f1 collector: sync bsd filesystem collector labels with linux 2015-11-02 19:16:17 -08:00
Nick Owens b58d1fc971 collector: add openbsd suport to filesystem colector 2015-11-01 19:17:11 -08:00
Matthias Rampke 2d0d72b97d Add license headers to all code files. 2015-09-26 17:44:39 +02:00
Martín Ferrari e3f217ea45 Build filesystem_common only on linux and freebsd. 2015-09-16 18:15:27 +03:00
Martín Ferrari dace6dc48b Fix issues from code review, and split common code into filesystem_common.go. 2015-09-16 16:34:34 +03:00