node_exporter icon indicating copy to clipboard operation
node_exporter copied to clipboard

fibre channel: symbolic_name attribute is not exposed to sysfs by all drivers

Open machine424 opened this issue 1 year ago • 2 comments

Host operating system: output of uname -a

node_exporter version: output of node_exporter --version

node_exporter command line flags

node_exporter log output

Are you running node_exporter in Docker?

What did you do that produced an error?

Used a driver that doesn't set the optional symbolic_name attribute: Drivers can choose not to expose attributes to sysfs: https://github.com/torvalds/linux/blob/047371968ffc470769f541d6933e262dc7085456/include/scsi/scsi_transport_fc.h#L721-L764

Apart of symbolic_name, other attributes may not be exposed (see link above), we should take that into consideration.

This will need changes at https://github.com/prometheus/procfs/blob/dd493f45ddad658c99c4e58989222082cc0a0a96/sysfs/class_fibrechannel.go#L92-L134

What did you expect to see?

node_fibrechannel_info exposed without the non existing attributes (set them to empty string). the others netrics exposed.

What did you see instead?

The collector fails with:

caller=collector.go:169 level=error msg="collector failed" name=fibrechannel duration_seconds=0.000490402 err="error obtaining FibreChannel class info: failed to read file \"/host/sys/class/fc_host/host0/symbolic_name\": open /host/sys/class/fc_host/host0/symbolic_name: no such file or directory"

machine424 avatar Feb 08 '24 10:02 machine424

@machine424 Good find! Want to take a stab at fixing this? Should be straight forward to set this to "" or "N/A" if it doesn't exist

discordianfish avatar Feb 10 '24 10:02 discordianfish

sure, I'll give it a try.

machine424 avatar Feb 13 '24 08:02 machine424