Closed dswarbrick closed 9 months ago
I wonder if we should make the values in the struct *string
and set it to nil if the file is not found.
I wonder if we should make the values in the struct
*string
and set it to nil if the file is not found.
Doing so means that consumers of this need to check for non-nil before using the struct members. I'm not sure if that's a good thing or not. Given that Prometheus does not store empty-string labels, my gut feeling is that it's more convenient to simply leave these struct members as empty strings if not found, meaning that node_exporter can just blindly assign them to labels.
Whilst a large majority do, not all InfiniBand drivers expose a board_id in sysfs.
Fixes: https://github.com/prometheus/node_exporter/issues/2769