Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
fearful-symmetry committed Jul 16, 2024
1 parent a53aa84 commit eff4e3b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .changelog/226.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
```release-note:enhancement
Add API for metrics from an alternate filesystem root, allow OperatingSystem() to read from an alternate filesystem root
The sysinfo APIs (e.g. `Host()`, `Process()`) now accept an optional argument to force reading from an alternative filesystem root. This can be useful inside of containers to read data from the Linux host.
```
5 changes: 5 additions & 0 deletions system.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ type ProviderOption func(*registry.ProviderOptions)

// WithHostFS returns a provider with a custom HostFS root path,
// enabling use of the library from within a container, or an alternate root path.
// For example, WithHostFS("/hostfs") could be used when these mounts are present
// in the container:
//
// - /proc:/hostfs/proc
// - /sys/fs/cgroup:/hostfs/sys/fs/cgroup
func WithHostFS(hostfs string) ProviderOption {
return func(po *registry.ProviderOptions) {
po.Hostfs = hostfs
Expand Down

0 comments on commit eff4e3b

Please sign in to comment.