jenningsloy318 / redfish_exporter

exporter to get metrics from redfish based hardware such as lenovo/dell/superc servers
Apache License 2.0
76 stars 62 forks source link

Update to Gofish v0.20.0 or later #87

Open stmcginnis opened 1 week ago

stmcginnis commented 1 week ago

I noticed redfish_exporter is still using an older version of the gofish library. Just wanted to point out that there have been quite a few updates and performance improvements since that version, so it would be great to update to the latest.

There are some caveats with the upgrade that make it a little more difficult than just running go get github.com/stmcginnis/gofish@latest though. The library has raised the minimum support Go version to v1.21. That version of Go reached its own end-of-life in August 2024, so it seems reasonable to have that as a minimum.

Some changes are needed in the following files:

collector/chassis_collector.go
collector/redfish_collector.go
collector/system_collector.go
config.go

There are minor changes in some of the redfish objects, and I noticed at least one spot where ioutil is being used. Another side effect of the Go upgrade is ioutil has been deprecated in Go 1.16. It has easy replacements in io and os though.

I tried making local updates to propose the upgrade myself but I wasn't sure about the current build and GitHub Action checks. It looks like the Docker builds use an image outside of this repo that will need its Go version upgraded as well.

stmcginnis commented 1 week ago

Feel free to ping me with any questions or issues too. Happy to help get things updated.