-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Enhance log messages with host name #4575
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
shwstppr
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@GabrielBrascher can we use something like host-name(ID: host_uuid)? Personally I found it easier at times to debug issues with uuid in logs
@blueorangutan package
|
@shwstppr That is something that I can add. Maybe this is something that we can discuss (on the mailing list or a Github issue) in order to find conventions that best fit CloudStack log messages. Nowadays we do not have any convention. |
|
Hey @shwstppr what do you suggest? I totally agree with @GabrielBrascher, normally when we are talking about a host we use their names to refer to it, I never met someone who uses UUID for this purpose.
it is too verbose and does not add anything to the debug factor. |
|
@RodrigoDLopez Hi, I don't have any issue in using just the names of host if we have consensus on that. |
But this will display uuid to users also right which doesnt make sense to them |
|
@ravening a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
Packaging result: ✔centos7 ✔centos8 ✔debian. JID-2553 |
For logging (and debugging), I think it is better to use either ID / UUID (with/without name) as the name is not unique (multiple hosts can have the same name, across the cloudstack env). |
|
What about adding all of them? I mean, ID, Name, and UUID. This would for sure help debugging. It would have the ID of the DB already there, and the UUID of the element that is used in the API. Moreover, the name to make the log entry more friendly. Something such as: |
|
@rafaelweingartner @sureshanaparti having ID, UUID, and the name sounds like a good way. Might be a bit verbose, but it serves well all the preferences. |
|
Applied changes in order to use the
The idea is that it would be good for:
Ping for discussion/review: @rafaelweingartner @sureshanaparti @shwstppr @RodrigoDLopez @DaanHoogland @rhtyd @wido @ustcweizhou @svenvogel @andrijapanicsb and others ... |
|
@GabrielBrascher it would be good to add host name in the output. ip is not very important as we normally ssh into server using hostname, not ip. |
|
@weizhouapache Sorry if I was not clear, but PR #4706 is adding the host's name indeed, IP address would not be interesting indeed. The idea is exactly what you mentioned. We will then log host ID, UUID, and Name (Type will also be logged the host.toString is used for non-routing hosts as well). This PR also uses the |
0ede66a to
5e304b9
Compare
|
@blueorangutan package |
|
@blueorangutan package |
|
@GabrielBrascher a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
@blueorangutan package |
|
@nvazquez a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
Packaging result: ✔️ centos7 ✔️ centos8 ✔️ debian. SL-JID 442 |
|
@blueorangutan test |
|
@nvazquez a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
server/src/main/java/com/cloud/capacity/CapacityManagerImpl.java
Outdated
Show resolved
Hide resolved
6eef535 to
73eccb4
Compare
GutoVeronezi
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice job @GabrielBrascher.
CLGTM, I raised one last point about toString.
server/src/main/java/com/cloud/resource/ResourceManagerImpl.java
Outdated
Show resolved
Hide resolved
|
Trillian test result (tid-1188)
|
|
Packaging result: ✔️ el7 ✔️ el8 ✔️ debian. SL-JID 457 |
|
Trillian test result (tid-1194)
|
|
@blueorangutan package |
|
@nvazquez a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
@blueorangutan package |
|
@nvazquez a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
Packaging result: ✔️ el7 ✔️ el8 ✖️ debian. SL-JID 522 |
|
Packaging result: ✔️ el7 ✔️ el8 ✔️ debian. SL-JID 523 |
|
@blueorangutan test |
|
@nvazquez a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
|
Trillian Build Failed (tid-1237) |
|
@blueorangutan test |
|
@nvazquez a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
|
Trillian test result (tid-1238)
|
nvazquez
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
Merging based on approvals and test results |
Description
Numbers are great for computers, however, we (humans) deal better with names. Logging host's ID is good in terms of short messages; however, admins must know all hosts by their ID or look via DB/API queries to figure out which host the log message is pointing to.
This PR proposes an admin friendly approach for log messages by logging the host name instead of its ID.
An example of how it works currently log messages can be painful in large environments:
Operation Failed vm's original host id: 334 new host id: 300 host id before state transition: 127Vs.
Operation Failed vm's original host: node23.clusterA new host: node09.clusterA host before state transition: node01.clusterATypes of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale