Skip to content
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

Configure Message Truncation in JS Library #1095

Open
jdnarvaez opened this issue Jan 31, 2023 · 1 comment
Open

Configure Message Truncation in JS Library #1095

jdnarvaez opened this issue Jan 31, 2023 · 1 comment

Comments

@jdnarvaez
Copy link

It seems this topic has been brought up a couple of times and an issue comment seems to indicate that the truncation length is configurable

Where do we configure the truncation length? Our messages are getting truncated and suffixed with ... and they are pretty short messages. It would be useful if we could change this behavior. Thanks.

@waltjones
Copy link
Contributor

Truncation isn't configurable. Even though function truncate(payload, jsonBackup, maxSize) in PR #630 linked above accepts a maxSize argument, it is never called with that argument and always uses the default 500K maxSize.

The current algorithm successively truncates strings to shorter lengths until the total payload is under maxSize. A good improvement would be to allow customizing the truncation strategies to prioritize the parts of the payload expected to be the most problematic and/or the most optional.

I'll keep this open and tag as an enhancement.

Note: It's possible to do custom truncation in a transform function. https://docs.rollbar.com/docs/javascript#transforming-the-payload

This runs before truncation and if the payload has been reduced to maxSize, the built-in truncation will be skipped.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants