We have very little logging (at any level) in our upgrade process which makes debugging upgrade issues in production quite difficult. At a minimum we should have logs for the major steps of the process, with a log when each step starts, completes successfully, or fails:
- Pre-upgrade cleanup
- Calculation of source URI for binary download
- Download of artifact and hash and signature files (this is partially logged right now)
- Hash and signature verification of the artifact
- Unpacking of the artifact
- Location of the artifact on disk and destination of unpack
- We should add debug-level logs for each file that gets extracted including the path from the archive and the destination path on the OS
- Final hash that is calculated
- Copying of the action store
- Change of the sym link
- Bookmarking of when the upgrade completed
- Invoking of the upgrade watcher
- Removal of the old downloads directory
Most of this code is contained in this function: https://github.com/elastic/elastic-agent/blob/b27a90780fdd0566c0575efe5bccc98289513b7f/internal/pkg/agent/application/upgrade/upgrade.go#110
We have very little logging (at any level) in our upgrade process which makes debugging upgrade issues in production quite difficult. At a minimum we should have logs for the major steps of the process, with a log when each step starts, completes successfully, or fails:
Most of this code is contained in this function: https://github.com/elastic/elastic-agent/blob/b27a90780fdd0566c0575efe5bccc98289513b7f/internal/pkg/agent/application/upgrade/upgrade.go#110