Add standalone long task detection integration
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- react-native, typescript
- Domain
- mobile-dev, observability
Research direction
Start by reading the existing stallTrackingIntegration and verifying the minimum React Native version that supports PerformanceObserver longtask entries. Resolve whether the integration complements or replaces stall tracking and whether it emits only metrics, then define tests for always-on reporting, configurable sampling and thresholds, durations, and user-set filtering attributes.
Written by the indexing model from the issue text.
Description
Summary
React Native exposes a PerformanceObserver API that supports longtask entry types. We should add a new integration that uses this to detect and report JS thread long tasks independently of tracing.
Motivation
Customer request. They want visibility into JS thread blocking at scale across their fleet — frequency, duration, and the ability to filter by custom attributes (userId, orgId, etc). Current stall tracking only attaches measurements to active transactions, so it misses long tasks that happen outside traced operations.
Requirements
- Always-on reporting — must work independently of active traces/transactions, with a configurable sample rate
- Configurable threshold — default 50ms from RN is too low for mobile; allow users to set their own (e.g. 200ms)
- Emit as metrics — report long task occurrences and durations via
Sentry.metricsso they're queryable/aggregatable in Dashboards, with user-set tags for filtering - Code origin (stretch) —
PerformanceObserverdoes not provide stack traces. Correlating with continuous profiling would be the path here, but depends on continuous profiling support landing first. Out of scope for v1.
Technical Notes
- RN's
PerformanceObserver.supportedEntryTypesincludeslongtask— need to verify minimum RN version - Existing
stallTrackingIntegrationuses asetTimeout-based watchdog for similar detection but is transaction-scoped. Consider whether to extend it or build a separate integration - The JS SDK's browser long task instrumentation creates spans; our use case is different (metrics, not spans) since it needs to work outside transactions
Open Questions
- Should we also emit long tasks as standalone spans (not tied to a root transaction) or strictly as metrics?
- Should this replace or complement the existing stall tracking integration?
- Dominant language
- TypeScript
- Stars
- 1.8k
- Forks
- 367
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 94
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from getsentry/sentry-react-native
-
React-Native Replays Task
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
getsentry/sentry-react-native#6680 · 1 comment ·
-
Improvement React-Native
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
getsentry/sentry-react-native#6143 · 2 comments ·
-
React-Native Task User Feedbacks
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
getsentry/sentry-react-native#5932 · 2 comments ·
-
React-Native Replays Task
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
getsentry/sentry-react-native#5882 · 1 comment ·
-
Good First Issue React-Native Task
Difficulty 1/5 Under an hour Newbie friendliness 65/100
getsentry/sentry-react-native#5771 · 1 comment ·
All issues in getsentry/sentry-react-native
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
copse-dev/agent-pane#2953 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug clawsweeper:linked-pr-open clawsweeper:needs-live-repro clawsweeper:no-new-fix-pr impact:message-loss issue-rating: 🐚 platinum hermit P2 regression
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
calcite-components needs triage refactor
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Esri/calcite-design-system#15203 ·