Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: expose MD raid component devices #674

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

robbat2
Copy link

@robbat2 robbat2 commented Oct 3, 2024

Expose what component devices are part of a MD raid device, as well as the most common flags per-component. This will enable a future node_exporter metric showing which component of a RAID had failed.

This PR builds up top of PR 505, implementing the requested changes to detect the known RAID types on a given system.

Reference: #505
Signed-off-by: Robin Johnson [email protected]

@robbat2 robbat2 force-pushed the rjohnson/mdstat-devices branch 4 times, most recently from 2c25043 to 1ad0a36 Compare October 3, 2024 19:13
ImSingee and others added 5 commits October 3, 2024 15:58
Note: rebased on top of master for reformatting

Signed-off-by: Singee <[email protected]>
Signed-off-by: Robin H. Johnson <[email protected]>
Note: rebased on top of master for reformatting

Signed-off-by: Singee <[email protected]>
Signed-off-by: Robin H. Johnson <[email protected]>
Note: rebased on top of master for reformatting

Signed-off-by: Singee <[email protected]>
Signed-off-by: Robin H. Johnson <[email protected]>
Expose what component devices are part of a MD raid device, as well as the most
common flags per-component. This will enable a future node_exporter metric
showing which component of a RAID had failed.

Signed-off-by: Robin H. Johnson <[email protected]>
Signed-off-by: Robin H. Johnson <[email protected]>
@robbat2 robbat2 force-pushed the rjohnson/mdstat-devices branch from 1ad0a36 to dca5b72 Compare October 3, 2024 23:13
@robbat2
Copy link
Author

robbat2 commented Oct 5, 2024

@SuperQ can you have a look at this please?

@dswarbrick
Copy link
Contributor

I'm pretty sure this is already at least partially implemented by the mdraid sysfs parsing, https://pkg.go.dev/github.com/prometheus/[email protected]/sysfs#Mdraid

Drawing attention once again to prometheus/node_exporter#1085 - I really think it's time to mark the old /proc/mdstat parser as deprecated, before any more technical debt gets added to it.

@SuperQ
Copy link
Member

SuperQ commented Oct 9, 2024

I agree, I think we should focus the effort on the sysfs /sys/block/md* parsing.

@robbat2
Copy link
Author

robbat2 commented Oct 12, 2024

@SuperQ can you please merge prometheus/node_exporter#3031 then - and I'll build on top of that to expose per-device state?

@SuperQ
Copy link
Member

SuperQ commented Oct 12, 2024

@robbat2 Sure, sounds good.

Faulty: strings.Contains(match[3], "(F)"),
Spare: strings.Contains(match[3], "(S)"),
Journal: strings.Contains(match[3], "(J)"),
Replacement: strings.Contains(match[3], "(R)"),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh! R stands for Replacement!

@Finomosec Finomosec mentioned this pull request Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants