FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

feat(android): Make tombstone merge time threshold configurable by markushi · Pull Request #6154 · getsentry/sentry-java · GitHub

feat(android): Make tombstone merge time threshold configurable - #6154

Merged
markushi merged 5 commits into
mainfrom
feat/configurable-tombstone-merge-threshold
Sep 25, 2026
Merged

markushi merged 5 commits into
mainfrom
feat/configurable-tombstone-merge-threshold

Conversation

Copy link
Copy Markdown
Member

📜 Description

Makes the time window used to merge a tombstone with a native crash event configurable. NativeEventCollector had a hardcoded TIMESTAMP_TOLERANCE_MS = 5000; it now reads SentryAndroidOptions.getTombstoneMergeTimeThresholdMillis(), which keeps 5000 ms as its default, so behavior does not change unless the option is set.

SentryAndroid.init(this, options -> options.setTombstoneMergeTimeThresholdMillis(10000));
<meta-data android:name="io.sentry.tombstone.merge-time-threshold-millis" android:value="10000" />

The matching code also logs the threshold together with the measured gap, and logs when no native event was inside the window, so a failed merge can be diagnosed from a debug log.

💡 Motivation and Context

A user reported that native crashes still arrive as signalhandler events with a thin native stack instead of TombstoneMerged. The gap between the tombstone timestamp and the native crash envelope was 5.786 s, just above the fixed 5 s window, so the two were never paired. There was no way to raise the window.

💚 How did you test it?

Unit tests in sentry-android-core:

  • NativeEventCollectorTest: a 5.8 s gap (the gap from the report) does not match with the default threshold, matches with the threshold raised to 10000 ms, and a 2 s gap does not match with the threshold lowered to 1000 ms.
  • ManifestMetadataReaderTest: the manifest value is applied, and the default is kept when the tag is absent.
  • SentryAndroidOptionsTest: default of 5000 ms and the setter.

📝 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.
  • Public API changes reviewed by another Mobile SDK team member or implemented according to the develop docs spec.

🔮 Next steps

The option is Android only, like the other tombstone options, so it is not wired into ExternalOptions (sentry.properties) or Spring Boot properties. Documentation for the new option can follow if the team wants it published.

🤖 Generated with Claude Code

linear-code Bot commented Sep 23, 2026

Copy link
Copy Markdown

JAVA-737

github-actions Bot commented Sep 23, 2026 •
edited
Loading

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

Generated by 🚫 dangerJS against 681988c

sentry Bot commented Sep 23, 2026 •
edited
Loading

Copy link
Copy Markdown

📲 Install Builds

Android

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

⚙️ sentry-android Build Distribution Settings

markushi marked this pull request as ready for review September 25, 2026 06:37
markushi added the sanity-check PR needs a lightweight review for obvious issues label Sep 25, 2026

runningcode left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM, just some nits

markushi merged commit b59e639 into main Sep 25, 2026
76 of 77 checks passed
markushi deleted the feat/configurable-tombstone-merge-threshold branch September 25, 2026 10:43
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

Labels

sanity-check PR needs a lightweight review for obvious issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make tombstone merge timestamp threshold configurable

2 participants


Back | FazBrowse Home | New Git URL