Repository navigation
Conversation
Retain the 50 oldest and 200 newest frames for exception and thread stack traces. Align the SDK frame budget with Relay while bounding frame conversion work. Fixes #4818
📲 Install BuildsAndroid
|
adinauer
marked this pull request as ready for review
November 17, 2026 13:24
adinauer
requested review from
markushi and
romtsn
and removed request for
a team
November 17, 2026 13:24
This branch has not been deployed
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.
📜 Description
Changes stack trace truncation to retain the 50 oldest and 200 newest frames instead of only the 100 newest frames.
The limit applies consistently to exception and thread stack traces. Sentry-owned frames are filtered before applying the limit, and only retained frames are converted to protocol objects to bound allocation work.
💡 Motivation and Context
Keeping frames from both ends preserves the origin of deep or recursive call stacks while retaining the most recent frames around the failure. The 250-frame policy matches Relay's current stack trace normalization limits and avoids sending frames that Relay would discard.
💚 How did you test it?
make format api./gradlew :sentry:test --tests io.sentry.SentryStackTraceFactoryTest --tests io.sentry.SentryExceptionFactoryTest --tests io.sentry.SentryThreadFactoryTest📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps
None.