-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Renderer file logging transport #6795
Conversation
@samitiilikainen Please sign your commit |
Move navigation logging to `setupLoggingForNavigationInjectable` to prevent cycle of injectables from occurring. Wasn't eventually needed for #6795 but still an improvement. Credit for the implementation goes to @Nokel81 , thanks! Signed-off-by: Sami Tiilikainen <97873007+samitiilikainen@users.noreply.github.com>
4b3aa2e
to
a7496aa
Compare
Move navigation logging to `setupLoggingForNavigationInjectable` to prevent cycle of injectables from occurring. Wasn't eventually needed for #6795 but still an improvement. Credit for the implementation goes to @Nokel81 , thanks! Signed-off-by: Sami Tiilikainen <97873007+samitiilikainen@users.noreply.github.com> Signed-off-by: Sami Tiilikainen <97873007+samitiilikainen@users.noreply.github.com>
267e139
to
bdc0878
Compare
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
37d7c96
to
3054af9
Compare
Conflicts have been resolved. A maintainer will review the pull request shortly. |
3054af9
to
ce33663
Compare
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
ce33663
to
8025482
Compare
8025482
to
0b6333d
Compare
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
0b6333d
to
c21ca70
Compare
Conflicts have been resolved. A maintainer will review the pull request shortly. |
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.
I noticed we have many console.warn
etc calls still in the core code. They show up in the dev tools console but not in the log file of course. Out of scope for this PR, just noting it.
import currentlyInClusterFrameInjectable from "../routes/currently-in-cluster-frame.injectable"; | ||
import { getClusterIdFromHost } from "../utils"; | ||
|
||
const rendererFileLoggerTransportInjectable = getInjectable({ |
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.
usually the filename matches the injectable name/id ?
}); | ||
|
||
window.addEventListener("beforeunload", onCloseFrame, { capture: true }); | ||
window.addEventListener("pagehide", onCloseFrame, { capture: true }); |
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.
Does this mean logging to file stops if the cluster frame is not in view? If I disconnect a cluster while on the catalog cluster list, any disconnect logging is missed?
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.
Not all logging. It stops cluster frame logging right before the iframe is removed from DOM (when also all code execution in that iframe should stop). Stopping logging of the cluster frame does not affect logging done by the renderer main frame (catalog page).
maxsize: 1024 * 1024, | ||
maxFiles: 0, | ||
tailable: true, |
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.
Not sure what the expectation is here, but I tested with a file that was just under 1M in size and observed that when the file reached 1M nothing more was written to the file or any other file, and nothing more was written to the developer tools console either??
rendererlogging.mov
This is on Ubuntu 22.04. I artificially padded the file with logs to get it near 1M in size.
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.
Thanks! Expectation was that it would keep writing logs and older lines would be lost but I was mistaken. I'll increase the maxFiles to allow it to properly rotate files.
Add file logging to renderer, writing separate log files for renderer main frame and each cluster frame. Related to lensapp/support-lens-extension#118 Signed-off-by: Sami Tiilikainen <97873007+samitiilikainen@users.noreply.github.com>
There is too much noise on debug level from api responses etc Signed-off-by: Sami Tiilikainen <97873007+samitiilikainen@users.noreply.github.com>
It seems cluster onbeforeunload is not triggered when iframe is removed from dom by the parent (when disconnecting a cluster). While on root/main frame the beforeunload event does work, it seems to be adviced to use pagehide instead. Signed-off-by: Sami Tiilikainen <97873007+samitiilikainen@users.noreply.github.com>
Signed-off-by: Sami Tiilikainen <97873007+samitiilikainen@users.noreply.github.com>
This should cover reloading main and cluster frames and closing cluster frame throught disconnecting cluster. No file handles should be left open now. Signed-off-by: Sami Tiilikainen <97873007+samitiilikainen@users.noreply.github.com>
Signed-off-by: Sami Tiilikainen <97873007+samitiilikainen@users.noreply.github.com>
Signed-off-by: Sami Tiilikainen <97873007+samitiilikainen@users.noreply.github.com>
c0ed6f7
to
e35e470
Compare
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.
Thanks for doing this!
(users with many many clusters may notice large disk usage by Lens due to all the new log files)
Does not seem to be needed for log files to be successfully closed and caused integration tests to fail. Signed-off-by: Sami Tiilikainen <97873007+samitiilikainen@users.noreply.github.com>
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.
Finally looks like this is green!
* General fixes for release-tool (#7238) * General fixes for release-tool Signed-off-by: Sebastian Malton <sebastian@malton.name> * Revert change to number of PRs retrieved Signed-off-by: Sebastian Malton <sebastian@malton.name> --------- Signed-off-by: Sebastian Malton <sebastian@malton.name> * Throw on errors in kubectlApplyFolder (#7239) Signed-off-by: Panu Horsmalahti <phorsmalahti@mirantis.com> * Quick fix for store migration version being wrong (#7243) Signed-off-by: Sebastian Malton <sebastian@malton.name> * Revert "Renderer file logging transport (#6795)" (#7245) Renderer file logging still caused UI freezing (at least on apple silicon macs) when cluster frame was open and main frame was reloaded. See #544 This reverts commit ac2d0e4. Signed-off-by: Sami Tiilikainen <97873007+samitiilikainen@users.noreply.github.com> * Fix extension install (#7247) * Fix extension install - Remove old bundled extension dependencies - Make sure external extensions are installed as optional Signed-off-by: Sebastian Malton <sebastian@malton.name> * Ignore ENOENT errors Signed-off-by: Sebastian Malton <sebastian@malton.name> * Add comment Signed-off-by: Sebastian Malton <sebastian@malton.name> --------- Signed-off-by: Sebastian Malton <sebastian@malton.name> * Release 6.4.0 Signed-off-by: Sebastian Malton <sebastian@malton.name> * Fix lint Signed-off-by: Sebastian Malton <sebastian@malton.name> --------- Signed-off-by: Sebastian Malton <sebastian@malton.name> Signed-off-by: Panu Horsmalahti <phorsmalahti@mirantis.com> Signed-off-by: Sami Tiilikainen <97873007+samitiilikainen@users.noreply.github.com> Co-authored-by: Panu Horsmalahti <phorsmalahti@mirantis.com> Co-authored-by: Sami Tiilikainen <97873007+samitiilikainen@users.noreply.github.com>
Add file logging to renderer, writing separate log files for renderer main frame and each cluster frame.
Closes file handles (otherwise left open by Winston) on main and cluster frame refresh and when cluster frame is closed through cluster disconnect.
Related to lensapp/support-lens-extension#118