Skip to content

feat(tombstones): Add option to attach raw tombstone as protobuf#5446

Merged
romtsn merged 11 commits into
mainfrom
rz/feat/attach-raw-tombstone
May 20, 2026
Merged

feat(tombstones): Add option to attach raw tombstone as protobuf#5446
romtsn merged 11 commits into
mainfrom
rz/feat/attach-raw-tombstone

Conversation

@romtsn
Copy link
Copy Markdown
Member

@romtsn romtsn commented May 18, 2026

📜 Description

Adds a new attachRawTombstone option (default false) that attaches the raw tombstone protobuf from ApplicationExitInfo.getTraceInputStream() as an attachment on native crash events.

Changes:

  • Hint.java: Added tombstone field with getter/setter
  • Attachment.java: Added fromTombstone(byte[]) factory method (tombstone.pb, application/x-protobuf)
  • SentryClient.java: Retrieves tombstone from hint and adds to envelope attachments
  • SentryAndroidOptions.java: Added attachRawTombstone boolean option with getter/setter
  • TombstoneIntegration.java: Buffers raw bytes from the trace InputStream before parsing, attaches when option is enabled
  • ManifestMetadataReader.java: Added io.sentry.tombstone.attach-raw manifest meta-data option

Usage

Kotlin (programmatic):

SentryAndroid.init(context) { options ->
    options.isAttachRawTombstone = true
}

AndroidManifest.xml:

<meta-data
    android:name="io.sentry.tombstone.attach-raw"
    android:value="true" />

💡 Motivation and Context

Allows users to get the raw tombstone protobuf alongside the parsed native crash event, useful for deeper post-mortem analysis.

💚 How did you test it?

Manually tested on a physical device (HMD Pulse, Android 15) by triggering a native crash in the sample app and verifying the tombstone attachment is present.

https://sentry-sdks.sentry.io/issues/7229399848/events/1e81d1e1ed9a400b78e1be7811776a18/

Downloaded the raw tombstone file and verified it can be correctly parsed and viewed via protoc:

tombstone.txt

📝 Checklist

  • I added GH Issue ID & Linear ID
  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.

🔮 Next steps

  • Update docs

romtsn and others added 2 commits May 18, 2026 15:49
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 18, 2026

Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against dd089bc

@sentry
Copy link
Copy Markdown

sentry Bot commented May 18, 2026

📲 Install Builds

Android

🔗 App Name App ID Version Configuration
SDK Size io.sentry.tests.size 8.41.0 (1) release

⚙️ sentry-android Build Distribution Settings

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 18, 2026

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 360.84 ms 435.80 ms 74.96 ms
Size 0 B 0 B 0 B

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
3d205d0 352.15 ms 432.53 ms 80.38 ms
27d7cf8 369.82 ms 422.62 ms 52.80 ms
33a08cc 267.08 ms 340.45 ms 73.37 ms
b750b96 408.98 ms 480.32 ms 71.34 ms
96eeafa 361.43 ms 455.07 ms 93.63 ms
22f4345 314.79 ms 375.02 ms 60.23 ms
8c1fb22 316.62 ms 352.78 ms 36.16 ms
cf708bd 434.73 ms 502.96 ms 68.22 ms
48277cd 320.38 ms 379.90 ms 59.52 ms
22f4345 307.87 ms 354.51 ms 46.64 ms

App size

Revision Plain With Sentry Diff
3d205d0 1.58 MiB 2.10 MiB 532.97 KiB
27d7cf8 1.58 MiB 2.12 MiB 549.42 KiB
33a08cc 1.58 MiB 2.12 MiB 555.28 KiB
b750b96 1.58 MiB 2.10 MiB 533.19 KiB
96eeafa 1.58 MiB 2.19 MiB 620.21 KiB
22f4345 1.58 MiB 2.29 MiB 719.83 KiB
8c1fb22 0 B 0 B 0 B
cf708bd 1.58 MiB 2.11 MiB 539.71 KiB
48277cd 0 B 0 B 0 B
22f4345 1.58 MiB 2.29 MiB 719.83 KiB

Previous results on branch: rz/feat/attach-raw-tombstone

Startup times

Revision Plain With Sentry Diff
5df4e18 321.92 ms 364.57 ms 42.65 ms

App size

Revision Plain With Sentry Diff
5df4e18 0 B 0 B 0 B

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@romtsn romtsn changed the title feat(android): Add option to attach raw tombstone as protobuf feat(tombstones): Add option to attach raw tombstone as protobuf May 18, 2026
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@romtsn romtsn marked this pull request as ready for review May 18, 2026 20:18
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 9a4963e. Configure here.

romtsn and others added 2 commits May 18, 2026 22:30
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@romtsn romtsn requested a review from supervacuus May 19, 2026 06:50
Copy link
Copy Markdown
Collaborator

@supervacuus supervacuus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good, only minor comments.

Just one general assessment: the tombstone also includes raw memory views into regions pointed to by register contents. These are potentially PII-relevant and should move the tombstone attachment into a PII category similar to minidumps. This might also raise storage retention as a follow-up.

romtsn and others added 3 commits May 19, 2026 22:14
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@romtsn
Copy link
Copy Markdown
Member Author

romtsn commented May 20, 2026

@supervacuus thanks for the review 🙏

@romtsn romtsn merged commit 69508a1 into main May 20, 2026
69 of 70 checks passed
@romtsn romtsn deleted the rz/feat/attach-raw-tombstone branch May 20, 2026 10:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants