prometheus-community / smartctl_exporter

Export smartctl statistics to prometheus
Apache License 2.0
264 stars 78 forks source link

fix: correct smartctl_device_bytes_written & smartctl_device_bytes_read for NVMe #211

Closed robbat2 closed 2 months ago

robbat2 commented 4 months ago

The NVMe specification says that the controller is responsible for reporting "Data Units Read" & "Data Units Written" converted as needed for logicial block sizes other than 512-bytes. smartmontools already has the correct** behavior.

What is correct in this case? For now, track what smartmontools does: take the counter, multiply by 512*1000, report the value.

We should be clear that it means the drive has read/written at most that many bytes.

This has a few impacts:

Reference: https://github.com/smartmontools/smartmontools/blob/11415ee0b9d5f4a22ddfb3722fdfb05e72372a03/smartmontools/nvmeprint.cpp#L394-L397 Closes: https://github.com/prometheus-community/smartctl_exporter/issues/122

robbat2 commented 3 months ago

@SuperQ bump

robbat2 commented 2 months ago

@SuperQ bump again