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

Pod termination timestamp #373

Open
Benzion18 opened this issue Oct 3, 2021 · 1 comment
Open

Pod termination timestamp #373

Benzion18 opened this issue Oct 3, 2021 · 1 comment

Comments

@Benzion18
Copy link

Hi,

We need to see when each pod is killed. But the timestamp is not printed. I would expect date + time near each terminated pod. How can we see it?

INFO[0000] terminating pod name=xxxxxxxxx namespace=my-namespace
INFO[0060] terminating pod name=yyyyyyyyy namespace=my-namespace
INFO[0121] terminating pod name=zzzzzzzzz namespace=my-namespace

@linki
Copy link
Owner

linki commented Jan 24, 2022

This happens by default when you run it interactively on your local machine.

When you run it as a container in Kubernetes or via $ docker run quay.io/linki/chaoskube (without -t) you'll see the full timestamp.

If you want to run it locally you can switch to a different log formatter, e.g. $ go run main.go --log-format json will print logs in json which contain the full timestamp.

Alternatively you can detach from the tty, e.g. run it via $ true | go run main.go 2>&1 | cat (taken from https://superuser.com/questions/1430872/how-to-simulate-a-shell-without-tty)

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