-
Notifications
You must be signed in to change notification settings - Fork 779
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
🚀 feat: implement logs streaming for pods #568
base: main
Are you sure you want to change the base?
🚀 feat: implement logs streaming for pods #568
Conversation
# Conflicts: # cyclops-ui/src/components/k8s-resources/Deployment.tsx
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@naineel1209 thanks for the PR! Looks awesome 🧡
Left some comments on code structure
cyclops-ui/src/components/k8s-resources/common/PodTable/PodLogs.tsx
Outdated
Show resolved
Hide resolved
…eel1209/cyclops into feat/log-streaming-for-pods
…eel1209/cyclops into feat/log-streaming-for-pods
…eel1209/cyclops into feat/log-streaming-for-pods
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@naineel1209, I tried testing it and noticed that when I fetch the logs, those are streamed as expected, but when the window with my Cyclops is not in focus or I change the tab in my browser, it stops the connection and refetches all the logs again. This results in duplicated logs.
Could Abort controller be at fault? To be honest if its the root cause we can remove it, but could you look into it?
- set the flag `openWhenHidden` to true in `fetchEventSource`
Hi @petar-cvit, I examined the issue, and it was happening due to the default behaviour of the I have resolved this issue by setting the |
closes #555
📑 Description
[BE]
[FE]
logs
state to store array of strings to easily manage logs by usinglogs.join("\n")
.logStream
function which streams the logs and sets it in the state.logsSignalController
state to be passed to thelogStream
function to handle the SSE connection scenarios i.e. close the connection via signal when modal is closed, close the current connection via signal and make a new signal for the new connection when the container tab is changed.Streamed Logs Demo + No more events fired after the modal is closed:
https://github.com/user-attachments/assets/1f3f5fdf-102d-4697-9188-002092279098
✅ Checks
ℹ Additional context