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

Feature request: jhack etail #157

Open
taurus-forever opened this issue May 23, 2024 · 3 comments
Open

Feature request: jhack etail #157

taurus-forever opened this issue May 23, 2024 · 3 comments

Comments

@taurus-forever
Copy link

Hi,

I am constantly using jhack tail to understand the deployment progress and monitor the internal charm activities.

Example:
Screenshot from 2024-05-23 12-20-31

I have to constantly open several tmux windows to monitor:

  1. jhack tail # to see juju events
  2. juju status --watch 1s
  3. juju debug-log --tail # overall charm progress / stuck
  4. juju debug-log --tail | grep ERROR # errors only to do not miss some in endless flying debug-log

It is a feature request to create high-level jhack etail to speed up initial setup.
The etail could be an enhanced tail which will show the last errors and the last debug-log...

P.S. Is it a time for some nice-aligned default tmux config for juju? jhack tmux???

@PietroPasotti
Copy link
Collaborator

funny enough I'd considered this in the past but I encountered a couple of issues:

  • tmux is hard to script: I'm using tmux-resurrect to autoload the layout, but I couldn't yet find a way to save/load what commands are running on each pane
  • I found it hard to generalize, as everyone likes their terminals :)

@taurus-forever
Copy link
Author

My tmux oneliner:

ubuntu@juju342:~$ cat ./new_model_tmux.sh 
#/bin/bash

juju add-model "test$(date +%s)" && tmux new-session '' \; \
  split-window -v \; \
  send-keys "echo 'Type your Juju commands here... '" C-m \; \
  split-window -h \; \
  send-keys 'juju status --watch 1s' C-m \; \
  split-window -v \; \
  send-keys 'juju model-config "logging-config=<root>=INFO;unit=DEBUG" ' C-m \; \
  send-keys 'juju debug-log --tail' C-m \; \
  split-window -v \; \
  send-keys 'juju debug-log --tail | grep ERROR' C-m \; \
  split-window -v \; \
  send-keys 'jhack tail' C-m \; \

tmux -2 attach-session -d

ubuntu@juju342:~$ ./new_model_tmux.sh 

As I am bored to type the same commands many times...

I agree, all pencils have different colors and flavors, but we have no recommendation/best-practices for newbies (which are comfortable to use AS IS).

@PietroPasotti
Copy link
Collaborator

I think a better place for this would be the charm-dev multipass blueprint

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants