fix(sdk-crash-detection): Allow ART memory/GC context through event stripper#118915
Merged
Conversation
…tripper Android SDK (getsentry/sentry-java#5428) added ArtContext (context key "art") to ANR events containing GC and heap memory stats parsed from ANR thread dumps. The sdk-crashes event_stripper was dropping the entire "art" context because it wasn't in the allowlist. Add all 11 ArtContext fields (gc.* and memory.*) under contexts.art so they survive stripping.
romtsn
approved these changes
Jul 2, 2026
…nt error event_data["contexts"] is typed as object so direct indexed assignment fails mypy. Use the already-imported set_path() instead.
runningcode
added a commit
that referenced
this pull request
Jul 2, 2026
…s_art_context That test belongs to PR #118915 (ART context). It was accidentally included twice in this branch's test file.
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.
Problem
The Android SDK (getsentry/sentry-java#5428) added
ArtContext(serialized under the"art"context key) to ANR events. It contains GC stats and heap memory info parsed from ANR thread dumps — exactly the data needed to understand whether OOM pressure contributed to an ANR.The
sdk_crashesevent stripper was silently dropping the entireartcontext because onlydeviceandoswere inEVENT_DATA_ALLOWLIST["contexts"].Fix
Add all 11
ArtContextfields undercontexts.artin the allowlist:gc.total_count,gc.total_time,gc.blocking_count,gc.blocking_time,gc.pre_oome_count,gc.waiting_timememory.free,memory.free_until_gc,memory.free_until_oome,memory.total,memory.maxAll values are numeric (
Long/Double→int/float), no PII risk.Test
Added
test_strip_event_data_keeps_art_contextwhich injects a fullartcontext (including asome_private_fieldthat should be stripped) and asserts only the allowlisted fields survive.--
View Junior Session in Sentry