-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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: Always truncate stored breadcrumb messages to 2kb #15819
Conversation
size-limit report 📦
|
timestamp: dateTimestampInSeconds(), | ||
...breadcrumb, | ||
// Breadcrumb messages can theoretically be infinitely large and they're held in memory so we truncate them not to leak (too much) memory | ||
message: breadcrumb.message ? truncate(breadcrumb.message, 2048) : breadcrumb.message, |
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.
Should we maybe provide an option for people to overwrite this value of 2kb?
Like maxMessageLength
as option in the breadcrumb integration.
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.
We didn't have this option before and nobody asked for it so I would say no.
We had this logic in the console instrumentation before but it probably makes sense to truncate all breadcrumbs to some degree for memory consumption reasons.
Acts as prework for #15818 because if we don't truncate error messages they will end up as very big strings in breadcrumbs.