Open zhucan opened 5 months ago
For what it's worth, there is already code in place to get rotational info as reported by udev: https://github.com/prometheus/node_exporter/blob/94ef5cc666ce6c797e1e7fbe9082cb1dc42af1f4/collector/diskstats_linux.go#L252-L258
However, I don't have that metric available on any of the systems I personally own, and I do have rotational info in sysfs for my disks. I would also be in favor of a sysfs based method for collecting rotational info, but it might be better suited to live in github.com/prometheus/procfs, in my opinion
Turns out it already does exist in procfs and I forgot about it!
https://pkg.go.dev/github.com/prometheus/procfs@v0.13.0/blockdevice#BlockQueueStats
Seems we would just need to utilize it
Yes, this seems like it would be easy to add to the diskstats
collector.