Open eyalkoren opened 2 years ago
I've started looking into changing go-sysinfo
to use a non cgo implementation to gather the required information for Darwin. It looks like the latest published tags for golang.org/x/sys
expose a more complete API to perform sysctl
and syscall
without relying on cgo or syscall.syscall6
calls.
I'm going to move this back to the Ready column as I haven't yet started implementing the necessary changes in go-sysinfo
.
Once the discovery part is handled, we will still need to adjust the per-user tmp dir copy. In macOS, the Go utility to create temp dir (or find tmp dir root) would return a path to a directory which is specific to the current user (i.e. the APM Server user).
AFAIK, the functionality to run as a different user we already have in place is applicable to macOS, which means that we can run echo $TMPDIR
as the target user and read the command output to reveal the user-specific temp folder.
Tracking the removal of the technical blockers in https://github.com/elastic/apm-server/issues/9185
Reopening until https://github.com/elastic/apm-server/issues/8718#issuecomment-1227416692 is addressed.
MacOS is mostly supported now without relying on cgo. However, the process start time is not supported yet, so we'll need to find an alternative to identify a process instance, which currently relies on PID+start-time.
The Java attacher discovery relies on go-sysinfo, which requires cgo for macOS, which is not built into APM Server. Optional alternatives:
sysctl
for listing processes, similar to https://github.com/mitchellh/go-psps
execution (we had this working already)