Skip to content

Improve logging of essential and optional requirements in hostagent logs #2578

@nirs

Description

@nirs

Description

The hostagent logs 3 groups of requirements - essential and optional, final, and number each requirement separately. This makes it harder to follow the logs or create a progress indicator using the steps number and total number.

The logs are harder to follow since they start with the less important details and put the important details at the end.

Example log, keeping only the requirement logs:

msg="[hostagent] Waiting for the essential requirement 1 of 2: \"ssh\""
msg="[hostagent] The essential requirement 1 of 2 is satisfied"
msg="[hostagent] Waiting for the essential requirement 2 of 2: \"user session is ready for ssh\""
msg="[hostagent] The essential requirement 2 of 2 is satisfied"
msg="[hostagent] Waiting for the optional requirement 1 of 6: \"systemd must be available\""
msg="[hostagent] The optional requirement 1 of 6 is satisfied"
msg="[hostagent] Waiting for the optional requirement 2 of 6: \"containerd binaries to be installed\""
msg="[hostagent] The optional requirement 2 of 6 is satisfied"
msg="[hostagent] Waiting for the optional requirement 3 of 6: \"kubeadm to be installed\""
msg="[hostagent] The optional requirement 3 of 6 is satisfied"
msg="[hostagent] Waiting for the optional requirement 4 of 6: \"kubeadm to be completed\""
msg="[hostagent] The optional requirement 4 of 6 is satisfied"
msg="[hostagent] Waiting for the optional requirement 5 of 6: \"kubernetes cluster to be running\""
msg="[hostagent] The optional requirement 5 of 6 is satisfied"
msg="[hostagent] Waiting for the optional requirement 6 of 6: \"coredns deployment to be running\""
msg="[hostagent] The optional requirement 6 of 6 is satisfied"
msg="[hostagent] Waiting for the guest agent to be running"
msg="[hostagent] Waiting for the final requirement 1 of 1: \"boot scripts must have finished\""
msg="[hostagent] The final requirement 1 of 1 is satisfied"

Suggested change:

  • Number all requirements instead of numbering each group - we have 10 steps in this example
  • Start with (number/total) - makes the progress very clear
  • Than what we wait for/completed
  • Don't quote the requirement string for more natural log style
  • Mention the type of the requirement at the end - only for for essential
  • Captialize requirement name at start of message (some cases like ssh are questioable)
msg="[hostagent] ( 1/10) Waiting for ssh (essential)"
msg="[hostagent] ( 1/10) Ssh satisfied"
msg="[hostagent] ( 2/10) Waiting for user session is ready for ssh (essential)
msg="[hostagent] ( 2/10) User session is ready for ssh satisfied"
msg="[hostagent] ( 3/10) Waiting for systemd must be available"
msg="[hostagent] ( 3/10) Systemd must be available satisfied"
msg="[hostagent] ( 4/10) Waiting for containerd binaries to be installed"
msg="[hostagent] ( 4/10) Containerd binaries to be installed satisfied
msg="[hostagent] ( 5/10) Waiting for kubeadm to be installed"
msg="[hostagent] ( 5/10) Kubeadm to be installed satisfied"
msg="[hostagent] ( 6/10) Waiting for kubeadm to be completed"
msg="[hostagent] ( 6/10) Kubeadm to be completed satisfied"
msg="[hostagent] ( 7/10) Waiting for kubernetes cluster to be running"
msg="[hostagent] ( 7/10) Kubernetes cluster to be running satisfied"
msg="[hostagent] ( 8/10) Waiting for coredns deployment to be running"
msg="[hostagent] ( 8/10) coredns deployment to be running satisfied"
msg="[hostagent] ( 9/10) Waiting for the guest agent to be running"
msg="[hostagent] ( 9/10) Guest agent to be running satisfied"
msg="[hostagent] (10/10) Waiting for boot scripts must have finished"
msg="[hostagent] (10/10) Boot scripts must have finished satisfied"

The completion line (e.g. "Guest agent to be running satisfied") is not great. Also some requirement names may need to be improved to work with this logging style.

This can work better if we use "Waiting until" and modify the requirement names:

msg="[hostagent] ( 9/10) Waiting until guest agent is running"
msg="[hostagent] ( 9/10) Guest agent is running"

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/clilimactl CLI user experienceenhancementNew feature or requesthelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions