Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App Start Tracking Not Working #4184

Closed
ninjz opened this issue Oct 16, 2024 · 2 comments
Closed

App Start Tracking Not Working #4184

ninjz opened this issue Oct 16, 2024 · 2 comments

Comments

@ninjz
Copy link

ninjz commented Oct 16, 2024

Description

Really struggling to get App Start tracking working for my RN app. The docs don't make it clear whether you must use native initialization for this to work.

I was finally able to get it to somewhat work on iOS by using native initialization and instantiating it in the AppDelegate like this:

   [SentrySDK startWithConfigureOptions:^(SentryOptions *options) {
     options.dsn = @"https://...ingest.us.sentry.io/...";
     options.environment = ENV;
     options.enablePerformanceV2 = true;
     // https://github.com/getsentry/sentry-react-native/issues/2981#issuecomment-1514705794
     options.tracesSampler = ^NSNumber * (SentrySamplingContext * samplingContext) {
         return 0;
     };

     options.debug = false;
   }];

However I'm not 100% sure it works because it doesn't show me the startup time but at least doesn't show up empty in the App Starts dashboard.

On Android, I was able to get it to work in production without native initialization, however after doing all this configuration for iOS it doesn't seem to work now. Maybe it will work differently if I push it to production?

I've gotten warnings like these:

  • [ReactNativeTracing] App start end has not been recorded, not adding app start span
  • [ReactNativeTracing] App start duration is over a minute long, not adding app start span.

Can someone please clarify how App Start tracking is supposed to be enabled? Do I need to use native initialization and what else am I missing that might not be clear from the docs?

@rwachtler
Copy link

rwachtler commented Oct 16, 2024

Hey @ninjz ! Thank you for reaching out here, would you mind sharing following info so we can resolve this problem faster:

  • SDK version
  • your Sentry.init(...) config in your JS / TS
    • make sure you set debug: true, this enables some further logging and helps getting further relevant info
  • do you use Expo?
  • Is your root component wrapped by Sentry.wrap(YourRootComponent)?

To give you a general answer - it's not needed to do native initialization of Sentry in your AppDelegate to get your app-starts instrumented by Sentry. Please make sure to undo those changes before we move forward, so there is no interference between Sentry.init in your JS/TS and the one you've in AppDelegate right now.

@ninjz
Copy link
Author

ninjz commented Oct 17, 2024

Thanks for the reply @rwachtler! I actually managed to figure it out shortly after posting this issue.

I saw that v6 of the SDK came out and decided to give that a try. After updating it ended up working without any of the native initialization.

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

No branches or pull requests

2 participants