Native gives us the data; the JS layer is where it has to land on the right span. Today, idle navigation spans (reactnavigation.ts, expoRouter.ts) and the user's own Sentry.startSpan(...) calls have no visibility into native module work that happened during them.
Goal
-
New integration: turboModulesIntegration() exported from packages/core/src/js/integrations/exports.ts.
-
On install, the integration:
- Calls into the native sink (Issue 1) to start a logical "JS observation window" tied to the active span (using
getActiveSpan()).
- On span end, pulls a delta of aggregate stats since the window started and attaches them as attributes (
turbo_module.<name>.<method>.call_count, ..._duration_ms, ..._error_count) — capped to top-N modules by duration to keep payload size sane.
- Adds a breadcrumb (
category: 'native.turbo_module', level: 'info') for any async call that exceeded a configurable threshold (slowCallThresholdMs, default 500ms) including module + method + duration.
-
Surface a tiny JS API for users who want explicit attribution:
Sentry.startSpan({ name: 'load profile' }, async () => {
// any TurboModule activity inside this callback is automatically attached
});
-
Auto-enabled when enableTurboModuleTracking (Issue 1) is on; no-op otherwise.
Native gives us the data; the JS layer is where it has to land on the right span. Today, idle navigation spans (
reactnavigation.ts,expoRouter.ts) and the user's ownSentry.startSpan(...)calls have no visibility into native module work that happened during them.Goal
New integration:
turboModulesIntegration()exported frompackages/core/src/js/integrations/exports.ts.On install, the integration:
getActiveSpan()).turbo_module.<name>.<method>.call_count,..._duration_ms,..._error_count) — capped to top-N modules by duration to keep payload size sane.category: 'native.turbo_module',level: 'info') for any async call that exceeded a configurable threshold (slowCallThresholdMs, default 500ms) including module + method + duration.Surface a tiny JS API for users who want explicit attribution:
Auto-enabled when
enableTurboModuleTracking(Issue 1) is on; no-op otherwise.