prometheus / prometheus/node_exporter
Add support for Linux SAS PHY counters
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 13.8k
- Forks
- 2.7k
- Avg merge
- 1d 23h
- Merged PRs (30d)
- 8
Description
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_countloss_of_dword_sync_countphy_reset_problem_countrunning_disparity_error_countnegotiated_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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Linux /sys/class/sas_phy/phy-0:0:0/ tree and inspect node_exporter's existing collector conventions for reading sysfs and attaching labels. Done means Linux exposes the four named error counters and negotiated_linkrate as Prometheus metrics, with the requested device and SAS labels where available.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, linux
- Domain
- observability-sre, operating-systems
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100