Skip to content

Improve logging in the upgrade process #1253

@joshdover

Description

@joshdover

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

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions