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

collectors/mdadm_linux: support reshape status + expose remaining mdstats #3163

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tamcore
Copy link

@tamcore tamcore commented Oct 22, 2024

Requires prometheus/procfs#679

This change allows the mdadm collector to properly catch raids that are currently undergoing conversion (reshaping), i.e. from RAID1 to RAID5.

Additionally, it also exposes the remaining stats like sync speed / percentage, etc.

@tamcore tamcore force-pushed the feat/mdstat-reshape branch 2 times, most recently from cca725b to 0bae5cf Compare October 30, 2024 09:21
@@ -98,6 +104,31 @@ var (
[]string{"device"},
nil,
)

blocksToBeSyncedDesc = prometheus.NewDesc(
prometheus.BuildFQName(namespace, "md", "blocks_tobesynced"),
Copy link
Member

Choose a reason for hiding this comment

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

why not to_be_synced? Seems better

Copy link
Author

Choose a reason for hiding this comment

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

Updated :)

nil,
)
blocksSyncedPctDesc = prometheus.NewDesc(
prometheus.BuildFQName(namespace, "md", "blocks_synced_pct"),
Copy link
Member

Choose a reason for hiding this comment

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

Ideally we would have a blocks_synced so this can be calculated from blocks_to_by_synced

Copy link
Author

Choose a reason for hiding this comment

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

No need to calculate anything, since we already have blocks_synced. I just added this bit, so all available data is exported (and it's one thing less to manually calculate later on in PromQL).

Copy link
Member

Choose a reason for hiding this comment

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

Ah I missed this. In that case just remove the blocks_synced_pct. This can be easily and cheaply calculated in PromQL and therefor is best practice to not expose it

Copy link
Author

Choose a reason for hiding this comment

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

Removed with e86fd7f

@tamcore tamcore force-pushed the feat/mdstat-reshape branch 2 times, most recently from f50c7a0 to e86fd7f Compare November 2, 2024 09:05
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.

2 participants