elastic / go-sysinfo

go-sysinfo is a library for collecting system information.
Apache License 2.0
6 stars 88 forks source link

Add support for custom hostfs in linux metrics, cleanup linux code #198

Closed fearful-symmetry closed 3 months ago

fearful-symmetry commented 11 months ago

closes https://github.com/elastic/go-sysinfo/issues/12

This adds a set of new public methods to system.go to allow for metrics from a custom filesystem root under linux.

The API design feels a bit awkward at points, but my goal was to make a non-breaking change that mostly followed the existing design idioms of the library.

The underlying linux implementation already had support for a custom filesystem root, but the option wasn't exposed publicly, so this is a fairly small change.

andrewkroh commented 3 months ago

Closing this in favor of #226.