Skip to content
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

fix(logging): add hostname to RemoteCommandRunner output watcher #7438

Merged
merged 1 commit into from
May 26, 2024

Conversation

soyacz
Copy link
Contributor

@soyacz soyacz commented May 15, 2024

When investigating parallel commands it's hard to diffirentiate their outputs. Fix to add hostname to each output line.

Also removing dozens of lines of scylla --help in sct logs as they don't bring us any benefit.

Testing

  • [ ]

PR pre-checks (self review)

  • I added the relevant backport labels
  • I didn't leave commented-out/debugging code

Reminders

  • Add New configuration option and document them (in sdcm/sct_config.py)
  • Add unit tests to cover my changes (under unit-test/ folder)
  • Update the Readme/doc folder relevant to this change (if needed)

When investigating parallel commands it's hard to diffirentiate their
outputs. Fix to add hostname to each output line.

Also removing dozens of lines of `scylla --help` in sct logs
as they don't bring us any benefit.
@soyacz soyacz added backport/none Backport is not required test-provision-aws Run provision test on AWS labels May 15, 2024
@soyacz soyacz requested review from fruch and vponomaryov May 15, 2024 11:34
@soyacz
Copy link
Contributor Author

soyacz commented May 15, 2024

from provision test I can see it works:

< t:2024-05-15 12:20:44,163 f:base.py         l:231  c:RemoteLibSSH2CmdRunner p:DEBUG > <10.4.0.172>: 12:20:44,161 |-INFO in ch.qos.logback.classic.joran.JoranConfigurator@76a3e297 - Registering current configuration as safe fallback point
< t:2024-05-15 12:20:44,171 f:base.py         l:231  c:RemoteLibSSH2CmdRunner p:DEBUG > <10.4.0.172>: 
< t:2024-05-15 12:20:44,466 f:base.py         l:143  c:RemoteLibSSH2CmdRunner p:DEBUG > <10.4.0.172>: Command "sudo  docker run  --network=host --label shell_marker=NCUP759BCAEO052ZGTIY --entrypoint /bin/bash -v $HOME/cs-hdr-counter_write-l1-c0-k1-deea75b2-dc71-4b64-afc2-d510df6a1fa8.hdr:/cs-hdr-counter_write-l1-c0-k1-deea75b2-dc71-4b64-afc2-d510df6a1fa8.hdr -d  scylladb/scylla:5.4.6 -c 'tail -f /dev/null'" finished with status 0
< t:2024-05-15 12:20:44,467 f:remote_base.py  l:521  c:RemoteLibSSH2CmdRunner p:DEBUG > <10.4.2.116>: Running command "/usr/bin/nodetool  status "...
< t:2024-05-15 12:20:44,617 f:base.py         l:231  c:RemoteLibSSH2CmdRunner p:DEBUG > <10.4.0.172>: ******************** Stress Settings ********************
< t:2024-05-15 12:20:44,617 f:base.py         l:231  c:RemoteLibSSH2CmdRunner p:DEBUG > <10.4.0.172>: Command:
< t:2024-05-15 12:20:44,619 f:base.py         l:231  c:RemoteLibSSH2CmdRunner p:DEBUG > <10.4.0.172>:   Type: write
< t:2024-05-15 12:20:44,619 f:base.py         l:231  c:RemoteLibSSH2CmdRunner p:DEBUG > <10.4.0.172>:   Count: 400,000
[...]
< t:2024-05-15 12:20:44,666 f:base.py         l:231  c:RemoteLibSSH2CmdRunner p:DEBUG > <10.4.0.172>: 
< t:2024-05-15 12:20:44,809 f:base.py         l:231  c:RemoteLibSSH2CmdRunner p:DEBUG > <10.4.0.172>: ===== Using optimized driver!!! =====
< t:2024-05-15 12:20:44,835 f:base.py         l:231  c:RemoteLibSSH2CmdRunner p:DEBUG > <10.4.0.172>: ===== Using optimized driver!!! =====
[...]
< t:2024-05-15 12:20:45,382 f:base.py         l:231  c:RemoteLibSSH2CmdRunner p:DEBUG > <10.4.0.172>: Connected to cluster: PR-provision-test-PR-7438-db-cluster-d7ec59a0, max pending requests per connection null, max connections per host 8
< t:2024-05-15 12:20:45,382 f:base.py         l:231  c:RemoteLibSSH2CmdRunner p:DEBUG > <10.4.0.172>: Datatacenter: eu-west; Host: /10.4.2.116; Rack: 1a
< t:2024-05-15 12:20:45,382 f:base.py         l:231  c:RemoteLibSSH2CmdRunner p:DEBUG > <10.4.0.172>: Datatacenter: eu-west; Host: /10.4.2.133; Rack: 1a
[...]
< t:2024-05-15 12:20:45,738 f:base.py         l:231  c:RemoteLibSSH2CmdRunner p:DEBUG > <10.4.2.116>: Datacenter: eu-west
< t:2024-05-15 12:20:45,739 f:base.py         l:231  c:RemoteLibSSH2CmdRunner p:DEBUG > <10.4.2.116>: ===================
< t:2024-05-15 12:20:45,739 f:base.py         l:231  c:RemoteLibSSH2CmdRunner p:DEBUG > <10.4.2.116>: Status=Up/Down
< t:2024-05-15 12:20:45,739 f:base.py         l:231  c:RemoteLibSSH2CmdRunner p:DEBUG > <10.4.2.116>: |/ State=Normal/Leaving/Joining/Moving

see that this will allow us better filtering out logs and tool like lnav colours it nicely:
image

Copy link
Contributor

@fruch fruch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@fruch fruch merged commit 9c59cc5 into scylladb:master May 26, 2024
7 checks passed
@vponomaryov
Copy link
Contributor

"No backport Needed" label was added before branching the "scylla 6.0".
Probably we want it to have there?

@fruch
Copy link
Contributor

fruch commented May 27, 2024

"No backport Needed" label was added before branching the "scylla 6.0".
Probably we want it to have there?

It's a nice to have

@soyacz
Copy link
Contributor Author

soyacz commented May 28, 2024

if backporting, do it along with #7493

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/none Backport is not required test-provision-aws Run provision test on AWS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants