getsentry / getsentry/sentry-java

Capture slow/frozen frames during entire visible lifecycle for Activities and Fragments

オープン
#5,049 コメント 6 件 リアクション 5 件 担当者 0 名 GitHub で見る
2. High Android Improvement Traces
主要言語
Kotlin
スター
1.4k
フォーク
478
平均マージ
2日 23時間
マージ済み PR(30日)
67

説明

### Problem Statement

Currently, Sentry's Activity/Fragment tracing only measures slow/frozen frames during the **load phase** (around onCreate). Everything after the initial load is lost.

**This creates a significant gap in UI performance monitoring:**

1. **Incomplete visibility** - Users experience frozen frames throughout their entire visible session on a screen, not just during initial load. Scrolling through lists, interacting with forms, animations during user actions - all these can cause jank but are currently invisible to Sentry.

2. **Firebase Performance parity gap** - Firebase Performance offers automatic **screen rendering traces** that track slow/frozen frames for the entire **visible lifecycle**:
- **Activities:** `OnActivityStarted()` → `OnActivityStopped()`
- **Fragments:** `OnFragmentResume()` → `OnFragmentPaused()`

This is one of the main reasons teams still run Firebase Performance alongside Sentry, adding SDK overhead and complexity.

3. **Real user impact unmeasured** - The most impactful frozen frames often happen during user interactions (button clicks, scroll, swipe gestures) rather than initial screen load. Without visible lifecycle tracking, we miss the frames that actually frustrate users.

**Context:** This request comes from multiple mobile teams at Delivery Hero (HungerStation/Pandora and other brands) who have validated the need for this feature in our internal Sentry working group.

### Solution Brainstorm

## Proposed Solution

Extend Activity/Fragment auto-instrumentation to capture slow/frozen frames for the **visible lifecycle**, not just the load phase.

### Implementation approach (matching Firebase Performance screen traces):

**For Activities:**
- **Start:** `OnActivityStarted()` - when the Activity becomes visible
- **Stop:** `OnActivityStopped()` - when the Activity is no longer visible

**For Fragments:**
- **Start:** `OnFragmentResume()` - when the Fragment becomes active
- **Stop:** `OnFragmentPaused()` - when the Fragment is paused

### What this captures:

- Frame rendering during user scroll interactions
- Jank during button presses and form interactions
- Animation performance throughout the visible session
- Any frozen frames that occur while the user is actively viewing the screen

### Expected benefits:

- **Full visibility** into UI performance throughout visible user sessions
- **Correlation with user actions** - Link frozen frames to specific interactions
- **Sampling compatibility** - Work with existing `TracesSamplerCallback` for controlling data volume
- **Dashboard integration** - Surface visible-lifecycle-wide metrics in Mobile Vitals

### Reference:

Firebase Performance screen traces: https://firebase.google.com/docs/perf-mon/screen-traces?platform=android

This feature would allow teams to consolidate on Sentry for mobile performance monitoring instead of running multiple SDKs.

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。