zawachte / lomba

Analyze Kubernetes cluster logs in an instant. Powered by Grafana and Loki.
Apache License 2.0
2 stars 1 forks source link

Stream logs in Loki #1

Open AxiomSamarth opened 1 year ago

AxiomSamarth commented 1 year ago

The current implementation loads the pod logs into Loki until the timestamp when we run lomba run. It will be great if we can stream pod logs in Loki.

AxiomSamarth commented 1 year ago

I have a solution proposed the linked PR where streaming is implemented.

As goroutines are employed to stream the pod logs, to keep them active, we need to ensure that the main doesn't terminate. Hence, a new flag stream-duration is newly introduced. This will keep main active and the streaming will continue for a duration as set by stream-duration. Default value of stream-duration is set to 1 hour.