setupGracefulShutdown
Static method that registers process signal handlers for SIGTERM and SIGINT so the
agent shuts down cleanly. This is especially useful in Kubernetes deployments where the
pod receives SIGTERM before termination.
Only registers handlers once, even if called multiple times.
Parameters
opts
Optional configuration.
opts.timeout
Shutdown timeout in milliseconds before the process exits.
Returns
void