Skip to content

fix(tracing): Enable fetch instrumentation when Expo SDK 56 expo/fetch is active #6225

Closed

Description

@antonis

Description

Expo SDK 56 replaces globalThis.fetch with a native implementation (expo/fetch) that bypasses XMLHttpRequest entirely. The Sentry React Native SDK disables fetch tracing on native (traceFetch: false) because RN's default fetch is a whatwg-fetch polyfill over XHR — tracing both would cause duplicates. However, with expo/fetch active, XHR instrumentation no longer captures network requests, resulting in:

  • Missing http.client spans for all fetch requests
  • Missing fetch breadcrumbs
  • No sentry-trace / baggage headers injected (broken distributed tracing)

Root Cause

  • reactNativeTracingIntegration defaults to traceFetch: false and traceXHR: true on native
  • breadcrumbsIntegration defaults to fetch: false on native
  • expo/fetch is a fully native Expo Module (ExpoFetchModule) that does not use XHR
  • XHR instrumentation never fires for expo/fetch requests

Affected Versions

  • Expo SDK 56+ (where expo/fetch is the default)
  • All versions of @sentry/react-native

Workaround

Users can manually enable fetch tracing and breadcrumbs:

Sentry.init({
  integrations: [
    Sentry.reactNativeTracingIntegration({ traceFetch: true }),
    Sentry.breadcrumbsIntegration({ fetch: true }),
  ],
});

Alternatively, opt out of expo/fetch by setting EXPO_PUBLIC_USE_RN_FETCH=1 in the .env file.

Proposed Fix

Detect expo/fetch at runtime via the Symbol.for('expo.builtin') marker that Expo's installGlobal sets on replaced globals, and flip traceFetch and fetch breadcrumbs to true when detected.

References

Activity

  1. linear-code commented on May 28, 2026

    @linear-code
  2. self-assigned this
    on May 28, 2026
  3. added a commit that references this issue on Jun 2, 2026
    7436d0f
  4. github-actions commented on Jun 11, 2026

    @github-actions
    Contributor

    A PR closing this issue has just been released 🚀

    This issue was referenced by PR #6226, which was included in the 8.14.0 release.

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