Skip to content

Commit 4a128f1

Browse files
authored
Merge pull request Expensify#87560 from callstack-internal/sentry/experimental-trace-lifecycle
[No QA][Sentry] Enable experimental profiling option
2 parents f6174d4 + 082a951 commit 4a128f1

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

src/setup/telemetry/setupSentry.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@ function setupSentry(): void {
1818
// When "Log Sentry to console" toggle is ON, it logs envelope contents to the console.
1919
transport: isDevelopment() ? makeDebugTransport : undefined,
2020
tracesSampleRate: 1.0,
21-
// 1. Profiling for Android is currently disabled because it causes crashes sometimes.
22-
// 2. When updating the profile sample rate, make sure it will not blow up our current limit in Sentry.
23-
profilesSampleRate: 0.1,
2421
enableAutoPerformanceTracing: true,
2522
enableUserInteractionTracing: true,
2623
integrations,
@@ -32,6 +29,17 @@ function setupSentry(): void {
3229
// In HybridApp, native SDK is initialized early in Application.onCreate (Android) and
3330
// AppDelegate (iOS) to capture breadcrumbs during native startup before JS loads.
3431
autoInitializeNativeSdk: !CONFIG.IS_HYBRID_APP,
32+
// We set experimental lifecycle value to enable profiling for whole spans. Without this option profile often is dropped early and we haven't the whole picture
33+
// See https://github.com/Expensify/App/issues/87489
34+
// eslint-disable-next-line @typescript-eslint/naming-convention
35+
_experiments: {
36+
profilingOptions: {
37+
// When updating the profile sample rate, make sure it will not blow up our current limit in Sentry.
38+
// This option replaces `profilesSampleRate`
39+
profileSessionSampleRate: 0.1,
40+
lifecycle: 'trace',
41+
},
42+
},
3543
});
3644

3745
Sentry.setTag(CONST.TELEMETRY.TAGS.BUILD_TYPE, CONFIG.IS_HYBRID_APP ? CONST.TELEMETRY.BUILD_TYPE_HYBRID_APP : CONST.TELEMETRY.BUILD_TYPE_STANDALONE);

0 commit comments

Comments
 (0)