Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/libs/telemetry/integrations/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,8 @@ const tracingIntegration = Sentry.reactNativeTracingIntegration({
shouldCreateSpanForRequest,
});

export {navigationIntegration, tracingIntegration, browserProfilingIntegration, breadcrumbsIntegration, consoleIntegration};
// The Reporting API is a browser-only feature, so there is no native integration. This stub keeps
// the web/native export shape in parity; it is filtered out of the integrations list on native.
const reportingObserverIntegration = undefined;

export {navigationIntegration, tracingIntegration, browserProfilingIntegration, breadcrumbsIntegration, consoleIntegration, reportingObserverIntegration};
11 changes: 10 additions & 1 deletion src/libs/telemetry/integrations/index.web.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,13 @@ const tracingIntegration = SentryReact.browserTracingIntegration({
shouldCreateSpanForRequest,
});

export {navigationIntegration, tracingIntegration, browserProfilingIntegration, breadcrumbsIntegration, consoleIntegration};
/**
* Reporting API integration (web only). Captures browser-emitted `crash` and `intervention`
* reports (e.g. out-of-memory interventions) that never surface as JS exceptions, giving us an
* early signal for browser-level crashes. See https://w3c.github.io/reporting/
*/
const reportingObserverIntegration = SentryReact.reportingObserverIntegration({
types: ['crash', 'intervention'],
});

export {navigationIntegration, tracingIntegration, browserProfilingIntegration, breadcrumbsIntegration, consoleIntegration, reportingObserverIntegration};
6 changes: 4 additions & 2 deletions src/setup/telemetry/setupSentry.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
import * as Sentry from '@sentry/react-native';
import {isDevelopment} from '@libs/Environment/Environment';
import {breadcrumbsIntegration, browserProfilingIntegration, consoleIntegration, navigationIntegration, tracingIntegration} from '@libs/telemetry/integrations';
import {breadcrumbsIntegration, browserProfilingIntegration, consoleIntegration, navigationIntegration, reportingObserverIntegration, tracingIntegration} from '@libs/telemetry/integrations';
import {processBeforeSendLogs, processBeforeSendTransactions} from '@libs/telemetry/middlewares';
import CONFIG from '@src/CONFIG';
import CONST from '@src/CONST';
import pkg from '../../../package.json';
import makeDebugTransport from './debugTransport';

function setupSentry(): void {
const integrations = [navigationIntegration, tracingIntegration, browserProfilingIntegration, breadcrumbsIntegration, consoleIntegration];
const integrations = [navigationIntegration, tracingIntegration, browserProfilingIntegration, breadcrumbsIntegration, consoleIntegration, reportingObserverIntegration].filter(
(integration): integration is NonNullable<typeof integration> => integration !== undefined,
);

Sentry.init({
dsn: CONFIG.SENTRY_DSN,
Expand Down
Loading