cloudstack icon indicating copy to clipboard operation
cloudstack copied to clipboard

Add logs to CPVM connection process

Open bernardodemarco opened this issue 1 year ago • 11 comments

Description

The logs related to the CPVM connection are not enough to perform a great troubleshooting process.

This PR, therefore, adds logs and improves the existing ones in order to facilitate the CPVM connection troubleshooting. Furthermore, the legacy CPVM log proxy classes have been removed, in order to let the CPVM classes use log4j dependencies directly.

Types of changes

  • [ ] Breaking change (fix or feature that would cause existing functionality to change)
  • [ ] New feature (non-breaking change which adds functionality)
  • [ ] Bug fix (non-breaking change which fixes an issue)
  • [X] Enhancement (improves an existing feature and functionality)
  • [ ] Cleanup (Code refactoring and cleanup, that may add test cases)
  • [ ] build/CI

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • [ ] Major
  • [x] Minor

Screenshots (if appropriate):

How Has This Been Tested?

  • I created a VM and accessed it through a CPVM.
  • Meanwhile, I verified that the messages were logged as expected.

bernardodemarco avatar Apr 16 '24 16:04 bernardodemarco

This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.

github-actions[bot] avatar Apr 17 '24 19:04 github-actions[bot]

@DaanHoogland, thanks for your review!

As logging standards in CloudStack are still under discussion (#8746), I'd rather keep logging the exceptions stacktraces at the error level.

Honestly, I do not see the point in turning off the stacktraces at the error level. For operators that have a minimum software development background, the stacktraces can be a useful way to perform troubleshooting processes.

On the other hand, if the operator has no knowledge of development, he might not understand the stacktraces, and that is fine, causing no harm.

Besides that, following along with what you've proposed in #8746, what happens when the operator chooses to turn the stacktraces down by setting the logs level to error? Are all exception logs be lost, since they are gonna be at debug level? If so, the difficulty of performing troubleshootings would increase significantly, as some errors/problems might be difficult to reproduce.

Honestly, I'm looking forward to see the outcome of the #8746 discussion and I commit myself to participate on it. However, as I've mentioned before, I'd rather keep the proposed changes related to the stacktraces at the error level the way they are.

bernardodemarco avatar Apr 17 '24 21:04 bernardodemarco

Codecov Report

Attention: Patch coverage is 3.57143% with 81 lines in your changes missing coverage. Please review.

Project coverage is 15.53%. Comparing base (a5508ac) to head (7f0ae89). Report is 1051 commits behind head on main.

Files with missing lines Patch % Lines
...m/cloud/consoleproxy/ConsoleProxyNoVNCHandler.java 0.00% 25 Missing :warning:
...om/cloud/consoleproxy/ConsoleProxyNoVncClient.java 0.00% 16 Missing :warning:
...n/java/com/cloud/consoleproxy/vnc/NoVncClient.java 0.00% 9 Missing :warning:
...ava/com/cloud/servlet/ConsoleProxyClientParam.java 0.00% 6 Missing :warning:
...om/cloud/consoleproxy/ConsoleProxyClientParam.java 0.00% 6 Missing :warning:
...om/cloud/consoleproxy/ConsoleProxyAjaxHandler.java 0.00% 1 Missing :warning:
...oud/consoleproxy/ConsoleProxyAjaxImageHandler.java 0.00% 1 Missing :warning:
...onsoleproxy/ConsoleProxyBaseServerFactoryImpl.java 0.00% 1 Missing :warning:
...com/cloud/consoleproxy/ConsoleProxyCmdHandler.java 0.00% 1 Missing :warning:
...va/com/cloud/consoleproxy/ConsoleProxyMonitor.java 0.00% 1 Missing :warning:
... and 14 more
Additional details and impacted files
@@              Coverage Diff              @@
##               main    #8924       +/-   ##
=============================================
+ Coverage     13.17%   15.53%    +2.36%     
- Complexity     9214    11962     +2748     
=============================================
  Files          2725     5490     +2765     
  Lines        258235   480765   +222530     
  Branches      40249    60266    +20017     
=============================================
+ Hits          34013    74697    +40684     
- Misses       219913   397811   +177898     
- Partials       4309     8257     +3948     
Flag Coverage Δ
uitests 4.17% <ø> (?)
unittests 16.30% <3.57%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov-commenter avatar Apr 29 '24 20:04 codecov-commenter

clgtm, can we now remove com.cloud.consoleproxy.util.Logger from the code base @bernardodemarco ? Just to deal with the technical debt. (we can always add a new proxy once we get wise ;)

@DaanHoogland, I have just removed the CPVM log proxy classes and updated the PR's description.

bernardodemarco avatar Jun 14 '24 21:06 bernardodemarco

clgtm, can we now remove com.cloud.consoleproxy.util.Logger from the code base @bernardodemarco ? Just to deal with the technical debt. (we can always add a new proxy once we get wise ;)

@DaanHoogland, I have just removed the CPVM log proxy classes and updated the PR's description.

thanks for honouring my obnoxious request @bernardodemarco .

DaanHoogland avatar Jun 17 '24 08:06 DaanHoogland

@blueorangutan package

DaanHoogland avatar Jun 17 '24 08:06 DaanHoogland

@DaanHoogland a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

blueorangutan avatar Jun 17 '24 08:06 blueorangutan

Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 9981

blueorangutan avatar Jun 17 '24 09:06 blueorangutan

@blueorangutan test alma9 kvm-alma9

DaanHoogland avatar Jun 17 '24 10:06 DaanHoogland

@DaanHoogland a [SL] Trillian-Jenkins test job (alma9 mgmt + kvm-alma9) has been kicked to run smoke tests

blueorangutan avatar Jun 17 '24 10:06 blueorangutan

[SF] Trillian test result (tid-10475) Environment: kvm-alma9 (x2), Advanced Networking with Mgmt server a9 Total time taken: 48808 seconds Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr8924-t10475-kvm-alma9.zip Smoke tests completed. 134 look OK, 0 have errors, 0 did not run Only failed and skipped tests results shown below:

Test Result Time (s) Test File

blueorangutan avatar Jun 18 '24 00:06 blueorangutan

@blueorangutan package

JoaoJandre avatar Aug 13 '24 19:08 JoaoJandre

@JoaoJandre a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

blueorangutan avatar Aug 13 '24 19:08 blueorangutan

Packaging result [SF]: ✖️ el8 ✖️ el9 ✖️ debian ✖️ suse15. SL-JID 10637

blueorangutan avatar Aug 13 '24 20:08 blueorangutan

Packaging result [SF]: ✔️ el8 ✔️ el9 ✖️ debian ✔️ suse15. SL-JID 10651

blueorangutan avatar Aug 14 '24 09:08 blueorangutan

@blueorangutan test

DaanHoogland avatar Aug 14 '24 10:08 DaanHoogland

@DaanHoogland a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests

blueorangutan avatar Aug 14 '24 10:08 blueorangutan

[SF] Trillian test result (tid-11075) Environment: kvm-ol8 (x2), Advanced Networking with Mgmt server ol8 Total time taken: 55725 seconds Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr8924-t11075-kvm-ol8.zip Smoke tests completed. 138 look OK, 1 have errors, 0 did not run Only failed and skipped tests results shown below:

Test Result Time (s) Test File
test_05_vmschedule_test_e2e Failure 362.40 test_vm_schedule.py

blueorangutan avatar Aug 15 '24 02:08 blueorangutan

Merging based on reviews/manual tests. The single failure here https://github.com/apache/cloudstack/pull/8924#issuecomment-2290433194 is not related (same thing happened on https://github.com/apache/cloudstack/pull/9209)

JoaoJandre avatar Sep 09 '24 18:09 JoaoJandre