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
Copy file name to clipboardExpand all lines: CHANGELOG.md
+6-1Lines changed: 6 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -68,8 +68,13 @@
68
68
- Discard envelopes on `4xx` and `5xx` response ([#4950](https://github.com/getsentry/sentry-java/pull/4950))
69
69
- This aims to not overwhelm Sentry after an outage or load shedding (including HTTP 429) where too many events are sent at once
70
70
71
-
### Feature
71
+
### Features
72
72
73
+
- Add new experimental option to capture profiles for ANRs ([#4899](https://github.com/getsentry/sentry-java/pull/4899))
74
+
- This feature will capture a stack profile of the main thread when it gets unresponsive
75
+
- The profile gets attached to the ANR event on the next app start, providing a flamegraph of the ANR issue on the sentry issue details page
76
+
- Breaking change: if the ANR stacktrace contains only system frames (e.g. `java.lang` or `android.os`), a static fingerprint is set on the ANR event, causing all ANR events to be grouped into a single issue, reducing the overall ANR issue noise
77
+
- Enable via `options.setEnableAnrProfiling(true)` or Android manifest: `<meta-data android:name="io.sentry.anr.enable-profiling" android:value="true" />`
73
78
- 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))
74
79
- Currently exposed via options as an _internal_ API only.
75
80
- 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
+80Lines changed: 80 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -351,6 +351,7 @@ public final class io/sentry/android/core/SentryAndroidOptions : io/sentry/Sentr
351
351
public fun isCollectExternalStorageContext ()Z
352
352
public fun isEnableActivityLifecycleBreadcrumbs ()Z
353
353
public fun isEnableActivityLifecycleTracingAutoFinish ()Z
354
+
public fun isEnableAnrProfiling ()Z
354
355
public fun isEnableAppComponentBreadcrumbs ()Z
355
356
public fun isEnableAppLifecycleBreadcrumbs ()Z
356
357
public fun isEnableAutoActivityLifecycleTracing ()Z
@@ -379,6 +380,7 @@ public final class io/sentry/android/core/SentryAndroidOptions : io/sentry/Sentr
379
380
public fun setDebugImagesLoader (Lio/sentry/android/core/IDebugImagesLoader;)V
380
381
public fun setEnableActivityLifecycleBreadcrumbs (Z)V
381
382
public fun setEnableActivityLifecycleTracingAutoFinish (Z)V
383
+
public fun setEnableAnrProfiling (Z)V
382
384
public fun setEnableAppComponentBreadcrumbs (Z)V
383
385
public fun setEnableAppLifecycleBreadcrumbs (Z)V
384
386
public fun setEnableAutoActivityLifecycleTracing (Z)V
@@ -533,6 +535,84 @@ public final class io/sentry/android/core/ViewHierarchyEventProcessor : io/sentr
533
535
public static fun snapshotViewHierarchyAsData (Landroid/app/Activity;Lio/sentry/util/thread/IThreadChecker;Lio/sentry/ISerializer;Lio/sentry/ILogger;)[B
534
536
}
535
537
538
+
public class io/sentry/android/core/anr/AggregatedStackTrace {
539
+
public fun <init> ([Ljava/lang/StackTraceElement;IIJF)V
540
+
public fun addOccurrence (J)V
541
+
public fun getStack ()[Ljava/lang/StackTraceElement;
542
+
}
543
+
544
+
public class io/sentry/android/core/anr/AnrCulpritIdentifier {
545
+
public fun <init> ()V
546
+
public static fun identify (Ljava/util/List;)Lio/sentry/android/core/anr/AggregatedStackTrace;
547
+
public static fun isSystemFrame (Ljava/lang/String;)Z
548
+
}
549
+
550
+
public class io/sentry/android/core/anr/AnrException : java/lang/Exception {
551
+
public fun <init> ()V
552
+
public fun <init> (Ljava/lang/String;)V
553
+
}
554
+
555
+
public class io/sentry/android/core/anr/AnrProfile {
556
+
public final field endtimeMs J
557
+
public final field stacks Ljava/util/List;
558
+
public final field startTimeMs J
559
+
public fun <init> (Ljava/util/List;)V
560
+
}
561
+
562
+
public class io/sentry/android/core/anr/AnrProfileManager : java/io/Closeable {
563
+
public fun <init> (Lio/sentry/SentryOptions;)V
564
+
public fun <init> (Lio/sentry/SentryOptions;Ljava/io/File;)V
565
+
public fun add (Lio/sentry/android/core/anr/AnrStackTrace;)V
566
+
public fun clear ()V
567
+
public fun close ()V
568
+
public fun load ()Lio/sentry/android/core/anr/AnrProfile;
569
+
}
570
+
571
+
public class io/sentry/android/core/anr/AnrProfileRotationHelper {
572
+
public fun <init> ()V
573
+
public static fun deleteLastFile (Ljava/io/File;)Z
574
+
public static fun getFileForRecording (Ljava/io/File;)Ljava/io/File;
575
+
public static fun getLastFile (Ljava/io/File;)Ljava/io/File;
576
+
public static fun rotate ()V
577
+
}
578
+
579
+
public class io/sentry/android/core/anr/AnrProfilingIntegration : io/sentry/Integration, io/sentry/android/core/AppState$AppStateListener, java/io/Closeable, java/lang/Runnable {
580
+
public static final field POLLING_INTERVAL_MS J
581
+
public static final field THRESHOLD_ANR_MS J
582
+
public fun <init> ()V
583
+
protected fun checkMainThread (Ljava/lang/Thread;)V
584
+
public fun close ()V
585
+
protected fun getProfileManager ()Lio/sentry/android/core/anr/AnrProfileManager;
586
+
protected fun getState ()Lio/sentry/android/core/anr/AnrProfilingIntegration$MainThreadState;
587
+
public fun onBackground ()V
588
+
public fun onForeground ()V
589
+
public fun register (Lio/sentry/IScopes;Lio/sentry/SentryOptions;)V
590
+
public fun run ()V
591
+
}
592
+
593
+
protected final class io/sentry/android/core/anr/AnrProfilingIntegration$MainThreadState : java/lang/Enum {
594
+
public static final field ANR_DETECTED Lio/sentry/android/core/anr/AnrProfilingIntegration$MainThreadState;
595
+
public static final field IDLE Lio/sentry/android/core/anr/AnrProfilingIntegration$MainThreadState;
596
+
public static final field SUSPICIOUS Lio/sentry/android/core/anr/AnrProfilingIntegration$MainThreadState;
597
+
public static fun valueOf (Ljava/lang/String;)Lio/sentry/android/core/anr/AnrProfilingIntegration$MainThreadState;
598
+
public static fun values ()[Lio/sentry/android/core/anr/AnrProfilingIntegration$MainThreadState;
599
+
}
600
+
601
+
public final class io/sentry/android/core/anr/AnrStackTrace : java/lang/Comparable {
602
+
public final field stack [Ljava/lang/StackTraceElement;
603
+
public final field timestampMs J
604
+
public fun <init> (J[Ljava/lang/StackTraceElement;)V
605
+
public fun compareTo (Lio/sentry/android/core/anr/AnrStackTrace;)I
606
+
public synthetic fun compareTo (Ljava/lang/Object;)I
607
+
public static fun deserialize (Ljava/io/DataInputStream;)Lio/sentry/android/core/anr/AnrStackTrace;
608
+
public fun serialize (Ljava/io/DataOutputStream;)V
609
+
}
610
+
611
+
public final class io/sentry/android/core/anr/StackTraceConverter {
612
+
public fun <init> ()V
613
+
public static fun convert (Lio/sentry/android/core/anr/AnrProfile;)Lio/sentry/protocol/profiling/SentryProfile;
614
+
}
615
+
536
616
public final class io/sentry/android/core/cache/AndroidEnvelopeCache : io/sentry/cache/EnvelopeCache {
537
617
public static final field LAST_ANR_MARKER_LABEL Ljava/lang/String;
538
618
public static final field LAST_ANR_REPORT Ljava/lang/String;
0 commit comments