You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[AGENTRUN-1124] Replace gopsutil fork with upstream where possible (#47700)
### What does this PR do?
Replace the gopsutil fork with upstream where possible, and isolate the remaining uses.
See below for the impact of some of the changes.
The fork is now only used on Darwin for live process collection, I'll look into that in a follow-up.
### Motivation
Remove the fork as much as possible.
### Describe how you validated your changes
CI
### Additional Notes
Changes with behavioral impact:
- `host.PlatformInformation()` on Darwin: `PlatformFamily` changes from always "darwin" to either "Standalone Workstation" or "Server".
- `host.PlatformInformation()` on Windows: version field previously returned "10.0.19041 Build 19041" (`WMI`). Now calls `KernelVersion()` instead, returning "10.0.19041.x Build 19041.x" (`RtlGetVersion`, same format, adds UBR patch revision).
- `host.BootTime()` on Linux (test only): upstream uses `/proc/uptime` float arithmetic in Docker/LXC containers instead of the integer btime from `/proc/stat`, so the test assertion is relaxed to within 1 second.
No behavior changes:
- `host.BootTime()` on Windows: different underlying API (`GetTickCount64` vs `WMI`), same result.
- `host.KernelVersion()` on Linux: `uname()` syscall vs `/proc/sys/kernel/osrelease`, same value.
- `host.PlatformInformation()` on Linux: upstream v4 respects `HOST_ETC` identically to the fork, same results for all supported distros.
- `host.Info()` on Linux: same fields and values, stale comment about missing containerized environment support removed.
- `process.MemoryMaps()`: struct literal replaced with `NewProcess()`, same behavior.
Co-authored-by: pierre.gimalac <pierre.gimalac@datadoghq.com>
0 commit comments