Add Sentry for error tracking and performance monitoring#644
Open
wyne wants to merge 4 commits into
Open
Conversation
Adds @sentry/react-native with release health, navigation tracing, and slow/frozen frame tracking to catch non-crash regressions (JS errors, perf degradation) that Crashlytics misses. - Sentry.init in src/sentry.ts, imported first in App.tsx and wrapped with Sentry.wrap for touch breadcrumbs and profiling - React Navigation integration registered on the NavigationContainer for screen-load transactions and time-to-initial-display - Metro config switched to getSentryExpoConfig for debug ID injection and symbolicated stack traces - Expo config plugin for source map upload during EAS builds - SDK disabled unless EXPO_PUBLIC_SENTRY_DSN is set (and never in dev) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
DSN presence is now the sole on/off switch so local dev clients can test reporting via a gitignored .env. Events are tagged with development/preview/production derived from the bundle id suffix. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
|
Coverage after merging feat/add-sentry into main will be
Coverage Report
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
|
Coverage after merging feat/add-sentry into main will be
Coverage Report
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
The DSN is a public ingestion identifier, not a secret. Production gets it via EAS environment variables once preview is validated. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
|
Coverage after merging feat/add-sentry into main will be
Coverage Report
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The v3.0.0 release shipped with UI lag (fixed in v3.0.1) and a usage drop that was invisible to existing telemetry: Crashlytics only sees crashes, and GA4 only shows fewer events after the fact. Sentry fills that gap with release health (crash-free session rate per version), navigation performance tracing (slow/frozen frames per screen), and capture of non-fatal JS errors and unhandled promise rejections.
What
src/sentry.ts—Sentry.initwith navigation integration, native frames tracking, session tracking, and 100% trace sampling (low event volume app). The SDK is fully disabled unlessEXPO_PUBLIC_SENTRY_DSNis set, and never runs in dev.App.tsx— Sentry module imported first (so init precedes store/firebase side effects); root component wrapped inSentry.wrapfor touch breadcrumbs and app-start tracing.src/Navigation.tsx— registers theNavigationContainerwith Sentry's React Navigation integration for screen-load transactions and time-to-initial-display.metro.config.js— switched togetSentryExpoConfig(wraps Expo's default config) for debug ID injection so stack traces symbolicate.app.config.js—@sentry/react-native/expoconfig plugin for source map upload during EAS builds; skipped with a warning whenSENTRY_AUTH_TOKENisn't present, so builds don't break before the Sentry project exists.jest.config.ts— added@sentry/.*to the transform allowlist.Setup required after merge
wyne/scorepad-react-native, or adjust viaSENTRY_ORG/SENTRY_PROJECTbuild env).EXPO_PUBLIC_SENTRY_DSN(plain text, not a secret) andSENTRY_AUTH_TOKEN(secret, for source map upload).Verification
eslintandtscpassnpx expo config --type prebuildresolves the config plugin cleanly🤖 Generated with Claude Code