Agent's shutdown sequence can be triggered by several different events, but our log messages don't indicate why the agent has decided to shutdown. This happens here:
|
logger.Info("Shutting down Elastic Agent and sending last events...") |
This can be an issue when debugging agent problems in the wild with customers where we have limited insight into the host running the software. We should add better logging to indicate why the agent has decided to shutdown (eg. which signal was received, etc.).
On Windows in particular we need to log when Windows service control events are received along with the signals the agent is handling.
Agent's shutdown sequence can be triggered by several different events, but our log messages don't indicate why the agent has decided to shutdown. This happens here:
elastic-agent/internal/pkg/agent/cmd/run.go
Line 254 in be3c48e
This can be an issue when debugging agent problems in the wild with customers where we have limited insight into the host running the software. We should add better logging to indicate why the agent has decided to shutdown (eg. which signal was received, etc.).
On Windows in particular we need to log when Windows service control events are received along with the signals the agent is handling.