You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* feat: minimal tombstone integration (disabled by default, options internal)
* redo a seemingly missed spotlessApply
* use non-plural option + mark integration also as internal + update API
* init size exceptions since we know we only need one
Co-authored-by: Markus Hintersteiner <m.hintersteiner@gmail.com>
* move `instructionAddressAdjustment` to `SentryStackTrace`
* add copyright notice to tombstone.proto
* add historical tombstone option
* looks like we need to add a TombstoneEventProcessor anyway.
* ...so let's add it to the options if the SDK supports it (adapt to >= S, since that is the earliest version where `REASON_CRASH_NATIVE` provides tombstones via the `traceInputStream`)
* Adapt `AndroidEnvelopeCache` to also write Tombstone timestamp markers
* Integrate handling of historical Tombstone option + last tombstone marker
This currently does not work:
While we now can optionally enable reporting of "historical" tombstones, by making the `TombstoneHint` `Backfillable` it will automatically be enriched by the `ANRv2EventProcessor` which is currently the only `BackfillingEventProcessor`.
The `ANRv2EventProcessor` is partially written in way that is potentially generic for events with `Backfillable` hints, but other parts are enriching as if those are always were ANRs, which up to now was true, but with Tombstones that assumption now breaks.
Next Steps:
* There is considerable duplication between the ANRv2Integration and TombstoneIntegration
* sprinkle with TODOs to highlight next PR steps
* fix typo
* implement TombstoneParser as Closable and close the tombstone stream
* tighten code with final and null annotations.
* eliminate obsolete null check
* Deduplicate ApplicationExitInfo handling for corresponding Integrations via HistoryDispatcher
* also update api dumps and formatting for sentry changes
* update tombstone message construction
* fix abortMessage check
* convert AnrV2EventProcessor to a more generic ApplicationExitInfoEventProcessor
this handles all events with Backfillable hint, but adds an interface HintEnricher, to allow hint-specific enrichment (like for ANRs) before and after the generic backfilling happened.
* reintroduce, update and correct old inline docs where they make sense.
* remove obsolete TombstoneEventProcessor
* clean up tombstone error handling
* convert ApplicationExitInfoHistoryDispatcher.removeLatest() to use an iterator instead of for-each
* add TombstoneIntegrationTest
* replace assertions with explicit RuntimeException
* use test base class for AEI
* remove obsolete TODO RE: mechanism change
* clarify open TODO RE: AbnormalExit discriminator for ANR hints
* refactor instructionAddressAdjustment from String to enum
* deduplicate hex formatting of addresses and TombstoneParser
* adapt tryEndPreviousSession() in EnvelopeCache to NativeCrashExit hint
* move isBackgroundAnr() to the AnrHintEnricher since it is only used there.
* revert method-references back to lambdas
* clean up exception assignment in TombstoneParser
* properly format the debug-id as an OLE GUID
* remove obsolete equality between code-id and debug-id
* ensure that errors in the char->digit conversion is also handled
* fix debugId/codeId look-up and checks in TombstoneIntegrationTest
* make movePreviousSession idempotent wrt the previous session
* reuse existing codeId -> debugId conversion instead of adding a new converter
* make PreviousSessionFinalizer aware of tombstone handled sessions and add crashedLastRun
* bump SDK config for TombstoneIntegrationTest to version 31 (S)
* add changelog entry
* retrieve test tombstone.pb fixture as a resource rather than a file path.
* attribute pb to be binary and re-commit the non-corrupted tombstone.pb
* reset crashedLastRun in PreviousSessionFinalizer and add test-case
* format
* fix Ok Session termination test
* format
* clarify comments and variable names in PreviousSessionFinalizer
* only enable distribution and sizeAnalysis if the SENTRY_AUTH_TOKEN environment variable is present and `isNotBlank()``
* compress tombstone test resource to reduce its repo weight down to less than 20%
* add round-trip serialization test for `instructionAddressAdjustment`
---------
Co-authored-by: Markus Hintersteiner <m.hintersteiner@gmail.com>
Copy file name to clipboardExpand all lines: CHANGELOG.md
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,6 +15,12 @@
15
15
- Discard envelopes on `4xx` and `5xx` response ([#4950](https://github.com/getsentry/sentry-java/pull/4950))
16
16
- This aims to not overwhelm Sentry after an outage or load shedding (including HTTP 429) where too many events are sent at once
17
17
18
+
### Feature
19
+
20
+
- Add a Tombstone integration that detects native crashes without relying on the NDK integration, but instead using `ApplicationExitInfo.REASON_CRASH_NATIVE` on Android 12+. ([#4933](https://github.com/getsentry/sentry-java/pull/4933))
21
+
- Currently exposed via options as an _internal_ API only.
22
+
- If enabled alongside the NDK integration, crashes will be reported as two separate events. Users should enable only one; deduplication between both integrations will be added in a future release.
Copy file name to clipboardExpand all lines: sentry-android-core/api/sentry-android-core.api
+38-7Lines changed: 38 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -141,13 +141,6 @@ public final class io/sentry/android/core/AnrIntegrationFactory {
141
141
public static fun create (Landroid/content/Context;Lio/sentry/android/core/BuildInfoProvider;)Lio/sentry/Integration;
142
142
}
143
143
144
-
public final class io/sentry/android/core/AnrV2EventProcessor : io/sentry/BackfillingEventProcessor {
145
-
public fun <init> (Landroid/content/Context;Lio/sentry/android/core/SentryAndroidOptions;Lio/sentry/android/core/BuildInfoProvider;)V
146
-
public fun getOrder ()Ljava/lang/Long;
147
-
public fun process (Lio/sentry/SentryEvent;Lio/sentry/Hint;)Lio/sentry/SentryEvent;
148
-
public fun process (Lio/sentry/protocol/SentryTransaction;Lio/sentry/Hint;)Lio/sentry/protocol/SentryTransaction;
149
-
}
150
-
151
144
public class io/sentry/android/core/AnrV2Integration : io/sentry/Integration, java/io/Closeable {
152
145
public fun <init> (Landroid/content/Context;)V
153
146
public fun close ()V
@@ -203,6 +196,13 @@ public final class io/sentry/android/core/AppState$LifecycleObserver : androidx/
203
196
public fun onStop (Landroidx/lifecycle/LifecycleOwner;)V
204
197
}
205
198
199
+
public final class io/sentry/android/core/ApplicationExitInfoEventProcessor : io/sentry/BackfillingEventProcessor {
200
+
public fun <init> (Landroid/content/Context;Lio/sentry/android/core/SentryAndroidOptions;Lio/sentry/android/core/BuildInfoProvider;)V
201
+
public fun getOrder ()Ljava/lang/Long;
202
+
public fun process (Lio/sentry/SentryEvent;Lio/sentry/Hint;)Lio/sentry/SentryEvent;
203
+
public fun process (Lio/sentry/protocol/SentryTransaction;Lio/sentry/Hint;)Lio/sentry/protocol/SentryTransaction;
204
+
}
205
+
206
206
public final class io/sentry/android/core/BuildConfig {
207
207
public static final field BUILD_TYPE Ljava/lang/String;
208
208
public static final field DEBUG Z
@@ -352,6 +352,8 @@ public final class io/sentry/android/core/SentryAndroidOptions : io/sentry/Sentr
352
352
public fun isEnableSystemEventBreadcrumbs ()Z
353
353
public fun isEnableSystemEventBreadcrumbsExtras ()Z
354
354
public fun isReportHistoricalAnrs ()Z
355
+
public fun isReportHistoricalTombstones ()Z
356
+
public fun isTombstoneEnabled ()Z
355
357
public fun setAnrEnabled (Z)V
356
358
public fun setAnrReportInDebug (Z)V
357
359
public fun setAnrTimeoutIntervalMillis (J)V
@@ -381,6 +383,8 @@ public final class io/sentry/android/core/SentryAndroidOptions : io/sentry/Sentr
381
383
public fun setNativeHandlerStrategy (Lio/sentry/android/core/NdkHandlerStrategy;)V
382
384
public fun setNativeSdkName (Ljava/lang/String;)V
383
385
public fun setReportHistoricalAnrs (Z)V
386
+
public fun setReportHistoricalTombstones (Z)V
387
+
public fun setTombstoneEnabled (Z)V
384
388
}
385
389
386
390
public abstract interface class io/sentry/android/core/SentryAndroidOptions$BeforeCaptureCallback {
@@ -469,6 +473,29 @@ public final class io/sentry/android/core/SystemEventsBreadcrumbsIntegration : i
469
473
public fun register (Lio/sentry/IScopes;Lio/sentry/SentryOptions;)V
470
474
}
471
475
476
+
public class io/sentry/android/core/TombstoneIntegration : io/sentry/Integration, java/io/Closeable {
477
+
public fun <init> (Landroid/content/Context;)V
478
+
public fun close ()V
479
+
public fun register (Lio/sentry/IScopes;Lio/sentry/SentryOptions;)V
480
+
}
481
+
482
+
public final class io/sentry/android/core/TombstoneIntegration$TombstoneHint : io/sentry/hints/BlockingFlushHint, io/sentry/hints/Backfillable, io/sentry/hints/NativeCrashExit {
483
+
public fun <init> (JLio/sentry/ILogger;JZ)V
484
+
public fun isFlushable (Lio/sentry/protocol/SentryId;)Z
485
+
public fun setFlushable (Lio/sentry/protocol/SentryId;)V
486
+
public fun shouldEnrich ()Z
487
+
public fun timestamp ()Ljava/lang/Long;
488
+
}
489
+
490
+
public class io/sentry/android/core/TombstoneIntegration$TombstonePolicy : io/sentry/android/core/ApplicationExitInfoHistoryDispatcher$ApplicationExitInfoPolicy {
491
+
public fun <init> (Lio/sentry/android/core/SentryAndroidOptions;)V
492
+
public fun buildReport (Landroid/app/ApplicationExitInfo;Z)Lio/sentry/android/core/ApplicationExitInfoHistoryDispatcher$Report;
493
+
public fun getLabel ()Ljava/lang/String;
494
+
public fun getLastReportedTimestamp ()Ljava/lang/Long;
495
+
public fun getTargetReason ()I
496
+
public fun shouldReportHistorical ()Z
497
+
}
498
+
472
499
public final class io/sentry/android/core/UserInteractionIntegration : android/app/Application$ActivityLifecycleCallbacks, io/sentry/Integration, java/io/Closeable {
473
500
public fun <init> (Landroid/app/Application;Lio/sentry/util/LoadClass;)V
474
501
public fun close ()V
@@ -495,11 +522,15 @@ public final class io/sentry/android/core/ViewHierarchyEventProcessor : io/sentr
495
522
}
496
523
497
524
public final class io/sentry/android/core/cache/AndroidEnvelopeCache : io/sentry/cache/EnvelopeCache {
525
+
public static final field LAST_ANR_MARKER_LABEL Ljava/lang/String;
498
526
public static final field LAST_ANR_REPORT Ljava/lang/String;
527
+
public static final field LAST_TOMBSTONE_MARKER_LABEL Ljava/lang/String;
528
+
public static final field LAST_TOMBSTONE_REPORT Ljava/lang/String;
499
529
public fun <init> (Lio/sentry/android/core/SentryAndroidOptions;)V
500
530
public fun getDirectory ()Ljava/io/File;
501
531
public static fun hasStartupCrashMarker (Lio/sentry/SentryOptions;)Z
502
532
public static fun lastReportedAnr (Lio/sentry/SentryOptions;)Ljava/lang/Long;
533
+
public static fun lastReportedTombstone (Lio/sentry/SentryOptions;)Ljava/lang/Long;
503
534
public fun store (Lio/sentry/SentryEnvelope;Lio/sentry/Hint;)V
504
535
public fun storeEnvelope (Lio/sentry/SentryEnvelope;Lio/sentry/Hint;)Z
0 commit comments