kdash icon indicating copy to clipboard operation
kdash copied to clipboard

Show merged logs from same containers in differents pod of 1 replicaset

Open vpartington opened this issue 3 years ago • 6 comments

Is your feature request related to a problem? Please describe. When I send a request to a service backed by a replicaset that has more than one pod, I cannot know in advance which pod will execute the request. I end up switching between all the pod backing the replicaset to find the one with the right logs. Or, if that is possible, I scale down the replicaset.

Describe the solution you'd like For a replicaset, see the containers defined in the pod template. When one of those containers is selected, the merged logs for all the pods that run that container are shown in a single view, ordered by timestamp, with the pod name as a prefix.

Describe alternatives you've considered

  • A quicker way to switch between logs of similar containers in a replicaset.
  • Not having to select a container in a pod when I want to see its log. In a lot of cases a pod runs just a single (main) container.

Additional context None.

vpartington avatar Jun 18 '21 09:06 vpartington

Interesting. I think it should be easy enough to implement the first part (show all pods -> containers for a replicaset), as I already have the infra in place, showing merged logs could be bit tricky due to how the underlying kube API streams logs. Do you know any other tool that does this so I can check how they implement the log merging?

deepu105 avatar Jun 18 '21 12:06 deepu105

stern? https://github.com/wercker/stern

somayaj avatar Jun 22 '21 02:06 somayaj

k9s does this, too. This is the main pain point for my usage that prevent me from switching from k9s.

Even a naive implementation that merge a log line as soon as it's read in a (EDIT: per container) streamer task/thread would help, as long as we can easily visually differentiate the origin pod (color is an OK differentiator... as long as the user is not visually impaired – ~10% of males are colorblind, I digress. ). The risk is to get out-of-order log lines amongst container, but in order for a given container, which is OK if the user is aware of this fact.

The next refinement is a way to hide/show/show-only a given container's logs from this view.

lisael avatar Oct 14 '21 07:10 lisael

I would need to look into this. Streaming logs was the most painful thing to build due to the way the underlying lib is implemented so this wont be an easy solution. I'll spend some time when I'm free. Just started a new job so it might be a while. But if you have an idea and want to try it let me know and I would be happy to help however possible.

Thanks & Regards, Deepu

On Thu, Oct 14, 2021 at 9:48 AM Lisael @.***> wrote:

k9s does this, too. This is the main pain point for my usage that prevent me from switching from k9s.

Even a naive implementation that merge a log line as soon as it's read in a streamer task/thread would help, as long as we can easily visually differentiate the origin pod (color is an OK differentiator... as long as the user is not visually impaired – ~10% of males are colorblind, I digress. ). The risk is to get out-of-order log lines amongst container, but in order for a given container, which is OK if the user is aware of this fact.

The next refinement is a way to hide/show/show-only a given container's logs from this view.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kdash-rs/kdash/issues/63#issuecomment-943101526, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAIOKFYEG4GUTBU3Z64E5XLUG2DLZANCNFSM465LL76A .

deepu105 avatar Oct 14 '21 10:10 deepu105

I peek at the code and I tell you if I feel confident enough to give it a try.

Thanks for the quick reply (and for kdash :) )

lisael avatar Oct 14 '21 10:10 lisael

You are welcome. I hope you feel comfortable enough to contribute. Feel free to ask me any questions, I'm in dire need of more contributors to keep the project going at a fast pace :)

Thanks & Regards, Deepu

On Thu, Oct 14, 2021 at 12:25 PM Lisael @.***> wrote:

I peek at the code and I tell you if I feel confident enough to give it a try.

Thanks for the quick reply (and for kdash :) )

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kdash-rs/kdash/issues/63#issuecomment-943224228, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAIOKF56CVMLP5DXG5FTEJ3UG2VZNANCNFSM465LL76A .

deepu105 avatar Oct 14 '21 12:10 deepu105