feat(core): Disable gen_ai message truncation by default when streamGenAiSpans is enabled#21603
Open
andreiborza wants to merge 5 commits into
Open
feat(core): Disable gen_ai message truncation by default when streamGenAiSpans is enabled#21603andreiborza wants to merge 5 commits into
streamGenAiSpans is enabled#21603andreiborza wants to merge 5 commits into
Conversation
fd07b23 to
d2d45f5
Compare
…GenAiSpans` is enabled Setting `streamGenAiSpans: true` now disables gen_ai input truncation by default. Because gen_ai spans are sent as v2 span envelope items, they are not subject to the transaction payload-size limits that truncation works around. Set `enableTruncation: true` on the respective AI integration to opt back into truncation.
d2d45f5 to
f15a1f7
Compare
Contributor
size-limit report 📦
|
nicohrubec
reviewed
Jun 17, 2026
| * Resolves whether truncation should be enabled. | ||
| * If the user explicitly set `enableTruncation`, that value is used. | ||
| * Otherwise, truncation is disabled when span streaming is active. | ||
| * Otherwise, truncation is disabled when gen_ai spans are streamed — either via full span |
Member
There was a problem hiding this comment.
nit: technically this should be more like "when gen_ai spans are sent through the span streaming/v2 path?
|
|
||
| ### Important Changes | ||
|
|
||
| - **feat(core): Disable gen_ai message truncation by default when `streamGenAiSpans` is enabled ([#21603](https://github.com/getsentry/sentry-javascript/pull/21603))** |
Member
There was a problem hiding this comment.
l: should we call this out? I think enableTruncation is not even documented and was meant more for internal testing no?
Member
Author
There was a problem hiding this comment.
No, probably not. I'll move it out of important.
Co-authored-by: Nicolas Hrubec <nicolas.hrubec@outlook.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Setting
streamGenAiSpans: truenow disables gen_ai input truncation by default. Because gen_ai spans are sent as v2 span envelope items, they are not subject to the transaction payload-size limits that truncation works around.Set
enableTruncation: trueon the respective AI integration to opt back into truncation.