-
Notifications
You must be signed in to change notification settings - Fork 176
Add process monitoring function with handlers #1144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Add process monitoring function with handlers #1144
Conversation
currentPids, err := process.Pids() | ||
if err != nil { | ||
logger.Error().Err(err).Msg("Error getting current processes") | ||
continue | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a quick note:
Can we watch for processes spawned by envd (run, command methods committed from our SDK)? I think monitoring all PIDs, except for some initial ones, will not work as systemd / other daemons can periodically spawn and kill processes, so current pids will be blown by some irrelevant processes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought of doing that initially but it wouldn't account for the processes spawned outside of it, one of the goals being to detect anomalous behavior.
…ground-routine-in-envd-that-monitors-newly-created-e2b-3002
Description
Implement a separate process monitoring background routine (i.e. not the one that tracks commands received via GRPC), by leveraging
gopsutil
to track and define how to handle new processes as they are running and exiting. This is the first step in sending process info to the events endpoint in the context of the internal sandbox events project.Test
Go test
Manual test
In
envd
'smain.go
: