-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
perf(node): Truncate breadcrumb messages created by console integration #14006
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
Conversation
size-limit report 📦
|
@@ -14,11 +17,17 @@ const _consoleIntegration = (() => { | |||
return; | |||
} | |||
|
|||
// Truncate the breadcrumb length to max 2KB including the truncated snippet | |||
let formattedMessage: string = util.format.apply(undefined, args); | |||
if (formattedMessage.length > MAX_BREADCRUMB_MSG_LENGTH) { |
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.
l: Why not just use truncate
from @sentry/utils
? :)
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 did not know that existed 🧠 nice
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.
Good change!
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.
suggestion: Can we add a test for this?
wait, I'm realizing you said yesterday that we don't have any tests for this integration. Maybe it's worth to address this as a whole in a separate PR then.
Fuck it, I'll be a good person for once and add tests 😂 |
We got a report that the SDK was consuming a lot of memory. Looking at the heap snapshot I noticed that we are unboundidly storing strings in breadcrumbs, no matter how large they are, leading to the breadcrumbs potentially holding a lot of memory.