canonical / jhack

Chock-full of Juju hackery.
Apache License 2.0
48 stars 23 forks source link

Feature request: jhack etail #157

Open taurus-forever opened 1 month ago

taurus-forever commented 1 month ago

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 commented 1 month ago

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

taurus-forever commented 1 month ago

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 commented 1 month ago

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