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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
- Expose `enableNetworkEventBreadcrumbs` (Android) to disable native network connectivity breadcrumbs ([#6764](https://github.com/getsentry/sentry-react-native/pull/6764))
- Expose native breadcrumb off-switches: `enableAutoBreadcrumbTracking` (iOS); `enableActivityLifecycleBreadcrumbs`, `enableAppLifecycleBreadcrumbs`, `enableSystemEventBreadcrumbs`, `enableAppComponentBreadcrumbs` (Android) ([#6768](https://github.com/getsentry/sentry-react-native/pull/6768))
- Expose `reportAccessibilityIdentifier` (iOS) to omit PII accessibility identifiers from the view hierarchy ([#6771](https://github.com/getsentry/sentry-react-native/pull/6771))
- Expose `enablePreWarmedAppStartTracing` (iOS) to opt out of app-start tracing for pre-warmed starts ([#6772](https://github.com/getsentry/sentry-react-native/pull/6772))
- Expose `enableMetricKitRawPayload` (iOS) to attach the raw MetricKit diagnostic payload to MetricKit events ([#6772](https://github.com/getsentry/sentry-react-native/pull/6772))

### Fixes

Expand Down
2 changes: 2 additions & 0 deletions packages/core/etc/sentry-react-native.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ export interface BaseReactNativeOptions {
enableHistoricalTombstoneReporting?: boolean;
enableMemoryIntrospection?: boolean;
enableMetricKit?: boolean;
enableMetricKitRawPayload?: boolean;
enableNative?: boolean;
enableNativeCrashHandling?: boolean;
enableNativeFramesTracking?: boolean;
Expand All @@ -182,6 +183,7 @@ export interface BaseReactNativeOptions {
enableNdkScopeSync?: boolean;
enableNetworkBreadcrumbs?: boolean;
enableNetworkEventBreadcrumbs?: boolean;
enablePreWarmedAppStartTracing?: boolean;
enableStallTracking?: boolean;
enableSystemEventBreadcrumbs?: boolean;
enableTombstone?: boolean;
Expand Down
23 changes: 23 additions & 0 deletions packages/core/src/js/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,17 @@ export interface BaseReactNativeOptions {
*/
enableMetricKit?: boolean;

/**
* When enabled, the native iOS SDK attaches the raw MetricKit diagnostic payload (as received
* from the operating system) to the events it creates from MetricKit diagnostics.
*
* Only has an effect when `enableMetricKit` is `true`.
*
* @default false
* @platform ios
*/
enableMetricKitRawPayload?: boolean;

/**
* When enabled, `SentryCrash` reads memory near the crash site while capturing a native crash
* (e.g. `EXC_BAD_ACCESS`) and embeds string-based stack contents in the event. This can help
Expand Down Expand Up @@ -456,6 +467,18 @@ export interface BaseReactNativeOptions {
*/
enableAppStartTracking?: boolean;

/**
* When enabled, the native iOS SDK also measures app start for pre-warmed app starts, where the
* operating system starts parts of the app ahead of time.
*
* Enabled by default in the native SDK; the default already accounts for pre-warm skew. Set this
* to `false` to opt out of app-start tracing for pre-warmed starts.
*
* @default true
* @platform ios
*/
enablePreWarmedAppStartTracing?: boolean;

/**
* Track the slow and frozen frames in the application. Enabling this options will add
* slow and frozen frames measurements to all created root spans (transactions).
Expand Down
34 changes: 34 additions & 0 deletions packages/core/test/wrapper.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,40 @@ describe('Tests Native Wrapper', () => {
expect(initParameter.reportAccessibilityIdentifier).toBe(false);
});

test('forwards enableMetricKitRawPayload to the Native SDK', async () => {
await NATIVE.initNativeSdk({
dsn: VALID_DSN,
enableNative: true,
autoInitializeNativeSdk: true,
enableMetricKitRawPayload: true,
devServerUrl: undefined,
defaultSidecarUrl: undefined,
mobileReplayOptions: undefined,
});

expect(RNSentry.initNativeSdk).toHaveBeenCalled();
// @ts-expect-error mock value
const initParameter = RNSentry.initNativeSdk.mock.calls[0][0];
expect(initParameter.enableMetricKitRawPayload).toBe(true);
});

test('forwards enablePreWarmedAppStartTracing to the Native SDK', async () => {
await NATIVE.initNativeSdk({
dsn: VALID_DSN,
enableNative: true,
autoInitializeNativeSdk: true,
enablePreWarmedAppStartTracing: false,
devServerUrl: undefined,
defaultSidecarUrl: undefined,
mobileReplayOptions: undefined,
});

expect(RNSentry.initNativeSdk).toHaveBeenCalled();
// @ts-expect-error mock value
const initParameter = RNSentry.initNativeSdk.mock.calls[0][0];
expect(initParameter.enablePreWarmedAppStartTracing).toBe(false);
});

test('filter beforeSend when initializing Native SDK', async () => {
await NATIVE.initNativeSdk({
dsn: VALID_DSN,
Expand Down
Loading