Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 prometheus/node_exporter#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., prometheus/node_exporter#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.