getsentry / sentry-react-native

Official Sentry SDK for React Native
https://sentry.io
MIT License
1.59k stars 337 forks source link

Self-Hosted received Replay ID but no replays #4261

Open iliapnmrv opened 2 weeks ago

iliapnmrv commented 2 weeks ago

What React Native libraries do you use?

React Navigation

Are you using sentry.io or on-premise?

on-premise (Self-Hosted)

@sentry/react-native SDK Version

6.1.0

How does your development environment look like?

os: macOS node: 18.19.0 npm: 10.2.3 react: 18.3.1 react-native: 0.75.4 hermesEnabled: true newArchEnabled: false

Sentry.init()

const reactNavigationIntegration = Sentry.reactNavigationIntegration({
  enableTimeToInitialDisplay: true,
});
const mobileReplayIntegration = Sentry.mobileReplayIntegration({
  maskAllText: false,
  maskAllImages: true,
  maskAllVectors: true,
});
const stallTrackingIntegration = Sentry.stallTrackingIntegration({});
const httpClientIntegration = Sentry.httpClientIntegration({
  failedRequestStatusCodes: [[500, 599]],
});

Sentry.init({
  dsn,
  integrations: [
    reactNavigationIntegration,
    mobileReplayIntegration,
    httpClientIntegration,
    stallTrackingIntegration,
  ],
  sendDefaultPii: true,
  attachScreenshot: true,
  release: version, // from package.json
  appHangTimeoutInterval: 1.2,
  tracesSampleRate: 1.0, // set for testing
  enableUserInteractionTracing: true,
  _experiments: {
    profilesSampleRate: 1.0,
    replaysSessionSampleRate: __DEV__ ? 1.0 : 0.5,
    replaysOnErrorSampleRate: 1.0,
  },
  debug: __DEV__,
});

I don't think this can be the reason but android/app/build.gradle

plugins {
    id "com.android.application"
    id "io.sentry.android.gradle" version "4.13.0"
}

import io.sentry.android.gradle.extensions.InstrumentationFeature
import io.sentry.android.gradle.instrumentation.logcat.LogcatLevel

sentry {
    includeNativeSources = true

    tracingInstrumentation {
      logcat {
        enabled = true
        minLevel = LogcatLevel.INFO
      }
    }

    autoInstallation {
      enabled = false
    }
}

Steps to Reproduce

  1. Run server npm run start
  2. Build android app npm run android
  3. Catch anything that will be sent in sentry
  4. I cannot see replay but I only see replay Id

Expected Result

Replay being in sentry

Actual Result

Sentry Logger [debug]: [Sentry] MobileReplay assign already recording replay 1abbc69d6ba44df6ba29f09416f743af for event bbf31b242e0f4f42a69dda81189eb52c.

Image

Replays tab in Sentry sidebar has no data

iliapnmrv commented 1 week ago

Tested on next.js web project, can see replays there. So the problem is not on self-hosted side

krystofwoldrich commented 1 week ago

Hi @iliapnmrv, thank you for the message, the Mobile Session Replay uses different envelope structure than the Web Session Replay so it's possible that the self hosted is not processing the mobile replay envelopes.

Could you share with us what version of self-hosted are you running?

iliapnmrv commented 1 week ago

@krystofwoldrich sure, it's 23.10.0.dev0. Unfortunately I could not find any requirements in docs

romtsn commented 1 week ago

@iliapnmrv 23.10.0 certainly does not support mobile replays, so I'd suggest you update to the latest version of self-hosted and see if it works. If not, you might need to tweak some flags - we can look into it later.