Skip to content

feat(server): Add scrub stats - #68

Open
patrickhampson wants to merge 1 commit into
pdf:masterfrom
patrickhampson:feat/pool-scrub-collector
Open

feat(server): Add scrub stats#68
patrickhampson wants to merge 1 commit into
pdf:masterfrom
patrickhampson:feat/pool-scrub-collector

Conversation

@patrickhampson

Copy link
Copy Markdown

Add scrub stats for pools by parsing zpool status

root@vault:~# curl -s http://localhost:9134/metrics | grep zfs_pool_scrub
# HELP zfs_pool_scrub_errors Number of errors detected during the most recent scrub or resilver.
# TYPE zfs_pool_scrub_errors gauge
zfs_pool_scrub_errors{pool="vault"} 0
# HELP zfs_pool_scrub_issued_bytes Bytes verified so far by the in-progress scrub or resilver, 0 if no scan is running.
# TYPE zfs_pool_scrub_issued_bytes gauge
zfs_pool_scrub_issued_bytes{pool="vault"} 8.565195580375e+12
# HELP zfs_pool_scrub_last_completed_timestamp_seconds Unix timestamp of the most recently completed scrub or resilver, or 0 if none.
# TYPE zfs_pool_scrub_last_completed_timestamp_seconds gauge
zfs_pool_scrub_last_completed_timestamp_seconds{pool="vault"} 0
# HELP zfs_pool_scrub_rate_bytes_per_second Current scan rate of the in-progress scrub or resilver, 0 if no scan is running.
# TYPE zfs_pool_scrub_rate_bytes_per_second gauge
zfs_pool_scrub_rate_bytes_per_second{pool="vault"} 8.81852416e+08
# HELP zfs_pool_scrub_repaired_bytes Bytes repaired during the most recent scrub or resilver.
# TYPE zfs_pool_scrub_repaired_bytes gauge
zfs_pool_scrub_repaired_bytes{pool="vault"} 0
# HELP zfs_pool_scrub_scanned_bytes Bytes read so far by the in-progress scrub or resilver, 0 if no scan is running.
# TYPE zfs_pool_scrub_scanned_bytes gauge
zfs_pool_scrub_scanned_bytes{pool="vault"} 1.143492092887e+13
# HELP zfs_pool_scrub_state State code for the most recent scrub or resilver [0: none, 1: scrub_in_progress, 2: scrub_finished, 3: scrub_canceled, 4: scrub_paused, 5: resilver_in_progress, 6: resilver_finished].
# TYPE zfs_pool_scrub_state gauge
zfs_pool_scrub_state{pool="vault"} 1
# HELP zfs_pool_scrub_total_bytes Total bytes to scan in the in-progress scrub or resilver, 0 if no scan is running.
# TYPE zfs_pool_scrub_total_bytes gauge
zfs_pool_scrub_total_bytes{pool="vault"} 3.3205251158835e+13

@patrickhampson
patrickhampson force-pushed the feat/pool-scrub-collector branch from ac712f1 to 8bd256d Compare June 1, 2026 06:03
@patrickhampson

Copy link
Copy Markdown
Author

@pdf bump on reviewing this one.

@pdf

pdf commented Aug 18, 2026

Copy link
Copy Markdown
Owner

Hi @patrickhampson sorry for the delay on this - I've just moved to the other side of the world and don't have access to my lab atm, should be back up and running in a month or two.

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