Closed dswarbrick closed 1 year ago
Nice, do we know how far back this kernel support goes?
Nice, do we know how far back this kernel support goes?
The mdraid sysfs stuff is pretty mature - it should go back as far as 2.6.x (yeah, for all those Synology NAS users...)
2.6.12 looks to contain the earliest documentation of mdraid sysfs interface: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/md.txt?h=v2.6.12, ca. April 2005.
Modernised method of fetching mdraid statistics via machine-readable sysfs entries, instead of parsing human-readable
/proc/mdstat
.This would go a long way towards addressing https://github.com/prometheus/node_exporter/issues/1085, as well as superseding / obsoleting various other pending PRs (#329) that attempt to squeeze a bit more info out of
/proc/mdstat
and issues, e.g., https://github.com/prometheus/node_exporter/issues/1874The mdraid sysfs entries contain significantly more detailed information that what is presented in the simplified and human-readable
/proc/mdstat
.I'd like to get a few more eyeballs on this code, and have it alongside the existing /proc/mdstat parser initially, with a view to perhaps making the
MDStat
function a wrapper around the new sysfs parser eventually (or refactor node_exporter to use the new function directly). ExistingMDStat
members ActivityState, DisksDown, DisksFailed, DisksSpare, DisksTotal, DisksActive can be derived / counted / calculated from information exposed by the newMdraid
struct.Some of the
MDStat
struct information is not exposed directly by/sys/block/md*/md
, however it is obtainable via other means. For example:/sys/block/*/size
(measured in 512-byte sectors - yes, even on 4K sector drives).Other
MDStat
struct members which are not currently used by node_exporter:rate()
function.@SuperQ I would greatly appreciate your review / input on this.