Skip to content

Expose additional native SDK options relevant to React Native (ANR, app-hang/app-start, breadcrumb toggles) #6747

Description

@antonis

Problem Statement

Several options in the underlying sentry-cocoa and sentry-java SDKs are not forwarded to React Native users, even though they cover native-only signals the JS layer can't observe (ANRs, app hangs, app-start, view hierarchy, native breadcrumbs). Because in RN most HTTP/errors/tracing live in JS, only the genuinely native-relevant options are proposed here.

Forwarding paths for reference: iOS relies on cocoa's dictionary parser (SentryOptionsInternal) plus explicit keys in RNSentryStart.m; Android maps every key by hand in RNSentryStart.java.

All options below already exist in the currently bundled native SDKs (cocoa 9.29.0, sentry-java 8.57.0).

Proposed — high value for RN

RN option Platform Native key Since (native) Native docs Why it matters for RN
anrTimeoutIntervalMillis Android setAnrTimeoutIntervalMillis sentry-java 2.1.0 app-not-responding ANRs fire on the Android main/UI thread every RN app has; JS can't tune this. iOS already exposes appHangTimeoutInterval — parity gap.
enableAnrTracking Android setAnrEnabled sentry-java 2.0.0 app-not-responding Master ANR toggle; today only killable by disabling all crash handling.
reportHistoricalAnrs Android setReportHistoricalAnrs sentry-java 6.24.0 app-not-responding Report ANRs from prior runs; parallels the already-exposed enableHistoricalTombstoneReporting.
enableReportNonFullyBlockingAppHangs iOS enableReportNonFullyBlockingAppHangs cocoa 8.39.0 app-hangs Pairs with the exposed enableAppHangTracking; app hangs are a native UI-thread signal invisible to JS.
enablePreWarmedAppStartTracing iOS enablePreWarmedAppStartTracing cocoa 8.0.0 options#enablePreWarmedAppStartTracing Pairs with exposed enableAppStartTracking; pre-warm skew corrupts a headline mobile metric only native can measure.
reportAccessibilityIdentifier iOS reportAccessibilityIdentifier cocoa 8.32.0 options#reportAccessibilityIdentifier PII knob for the exposed attachViewHierarchy. Must be gated on sendDefaultPii.

Proposed — noise-reduction batch (expose primarily as opt-out)

Native HTTP breadcrumbs largely duplicate what the JS SDK already records, so the value is the off-switch, not the feature.

RN option Platform Native key Since (native) Native docs
enableNetworkBreadcrumbs iOS enableNetworkBreadcrumbs cocoa 7.6.0 options#enableNetworkBreadcrumbs
enableAutoBreadcrumbTracking iOS enableAutoBreadcrumbTracking cocoa 7.21.0 options#enableAutoBreadcrumbTracking
enableActivityLifecycleBreadcrumbs Android setEnableActivityLifecycleBreadcrumbs sentry-java 2.1.0 breadcrumbs
enableAppLifecycleBreadcrumbs Android setEnableAppLifecycleBreadcrumbs sentry-java 2.1.0 breadcrumbs
enableSystemEventBreadcrumbs Android setEnableSystemEventBreadcrumbs sentry-java 2.1.0 breadcrumbs
enableAppComponentBreadcrumbs Android setEnableAppComponentBreadcrumbs sentry-java 2.1.0 breadcrumbs
enableNetworkEventBreadcrumbs Android setEnableNetworkEventBreadcrumbs sentry-java 6.17.0 (not documented upstream)
enableMetricKitRawPayload iOS enableMetricKitRawPayload cocoa 8.29.0 options#enableMetricKitRawPayload

Out of scope (low value for RN)

  • propagateTraceparent — traceparent propagation only matters for requests the native layer originates, which is rare in RN (fetch/XHR + propagation are handled in JS).
  • attachAllThreads — only adds value on native crashes (the minority in RN) and is currently non-functional; needs a separate cleanup decision.

Notes

  • Each new option must work on both architectures (New + Old) and be gated appropriately (e.g. reportAccessibilityIdentifier on sendDefaultPii).
  • The iOS options above are already read by cocoa's dict parser, so most need only a type + JSDoc; the Android options each need a mapping line in RNSentryStart.java.
  • Related bug (tracked separately): shutdownTimeout is silently ignored on iOS.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions