node_exporter icon indicating copy to clipboard operation
node_exporter copied to clipboard

Add IO stats and ext4 FS stats through new ext4 collector

Open mshahzeb opened this issue 10 months ago • 3 comments

Opened in place of: https://github.com/prometheus/node_exporter/pull/3047

Fixes: https://github.com/prometheus/node_exporter/issues/3005

Adds:

# HELP node_filesystem_errors Number of filesystem errors encountered.
# TYPE node_filesystem_errors counter
node_filesystem_errors{device="/dev/vda2",device_error="",fstype="ext4",mountpoint="/boot"} 0

# HELP node_filesystem_warnings Number of filesystem warnings encountered.
# TYPE node_filesystem_warnings counter
node_filesystem_warnings{device="/dev/vda2",device_error="",fstype="ext4",mountpoint="/boot"} 0

# HELP node_filesystem_messages Number of filesystem log messages.
# TYPE node_filesystem_messages counter
node_filesystem_messages{device="/dev/vda2",device_error="",fstype="ext4",mountpoint="/boot"} 0

From

  • /sys/fs/ext4/<partition>/errors_count: number of ext4 errors (commit)
  • /sys/fs/ext4/<partition>/warning_count: number of ext4 warning log messages (commit)
  • /sys/fs/ext4/<partition>/msg_count: number of other ext4 log messages

and

# HELP node_disk_ioerr_total Number of IO commands that completed with an error.
# TYPE node_disk_ioerr_total counter
node_disk_ioerr_total{device="sda"} 3
node_disk_ioerr_total{device="sr0"} 29

# HELP node_disk_iodone_total Number of completed or rejected IO commands.
# TYPE node_disk_iodone_total counter
node_disk_iodone_total{device="sda"} 307
node_disk_iodone_total{device="sr0"} 4483

From

  • /sys/block/<disk>/device/ioerr_cnt: number of SCSI commands that completed with an error
  • /sys/block/<disk>/device/iodone_cnt: number of completed or rejected SCSI commands

Implements new ext4 collector.

Corresponding procfs changes: https://github.com/prometheus/procfs/pull/651

mshahzeb avatar Apr 01 '25 00:04 mshahzeb

@SuperQ @discordianfish

Hey! Can you pls give this a review whenever you can. Thanks!

mshahzeb avatar Apr 01 '25 22:04 mshahzeb

Having support for xfs filesystem would be greatly appreciated

nandanatur avatar Jun 04 '25 15:06 nandanatur

If @mshahzeb is not interested in continuing this, feel free to submit a new PR based on https://github.com/prometheus/procfs/pull/651

discordianfish avatar Nov 12 '25 09:11 discordianfish