node_exporter icon indicating copy to clipboard operation
node_exporter copied to clipboard

Add support for Linux SAS PHY counters

Open scottlaird opened this issue 2 years ago • 1 comments

node_exporter should include SAS PHY metrics on Linux, to help expose SAS cable and device problems. Linux natively tracks 4 different counters and one useful gauge in /sys:

$ ls -1  /sys/class/sas_phy/phy-0:0:0/
device
device_type
enable
hard_reset
initiator_port_protocols
invalid_dword_count
link_reset
loss_of_dword_sync_count
maximum_linkrate
maximum_linkrate_hw
minimum_linkrate
minimum_linkrate_hw
negotiated_linkrate
phy_identifier
phy_reset_problem_count
power
running_disparity_error_count
sas_address
subsystem
target_port_protocols
uevent

It'd be useful to have these exported to Prometheus:

  • invalid_dword_count
  • loss_of_dword_sync_count
  • phy_reset_problem_count
  • running_disparity_error_count
  • negotiated_linkrate

Where possible, metrics should be labelled with /dev device names, sas_addresses, sas_host names, sas_enclosure names, and sas_end_device names, to make it possible identify which devices are impacted by identified issues.

I don't see a reasonable OS-independent pure-Go way to get this type of data, so the most reasonable implementation is to crawl Linux's /sys tree.

If no one else is working on this, then I'll take a shot at it.

scottlaird avatar May 31 '22 18:05 scottlaird

Presumably, adding support to https://github.com/prometheus/procfs would be the first step.

scottlaird avatar May 31 '22 18:05 scottlaird