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

WARN on Reload after Expo/Sentry Updated: WARN Sentry Logger [warn]: [ReactNativeTracing] Not instrumenting App Start because this start was already reported." #4164

Closed
6 of 11 tasks
DrStoop opened this issue Oct 10, 2024 · 7 comments

Comments

@DrStoop
Copy link

DrStoop commented Oct 10, 2024

OS:

  • Windows
  • MacOS
  • Linux

Platform:

  • iOS
  • Android

SDK:

  • @sentry/react-native (>= 1.0.0)
  • react-native-sentry (<= 0.43.2)

SDK version: 5.24.3

react-native version: 0.74.5

Are you using Expo?

  • Yes
  • No

Are you using sentry.io or on-premise?

  • sentry.io (SaaS)
  • on-premise

If you are using sentry.io, please post a link to your issue so we can take a look:

[Link to issue]

Configuration:

(@sentry/react-native)

if (__DEV__) {
  // Load Reactotron configuration in development. We don't want to
  // include this in our production bundle, so we are using `if (__DEV__)`
  // to only execute this in development.
  require('@/devTools/ReactotronConfig')
}
import { Stack, useNavigationContainerRef } from 'expo-router';
import * as SplashScreen from 'expo-splash-screen';
import { useEffect } from 'react';
import * as Sentry from '@sentry/react-native';
// import 'react-native-reanimated';
import { useInitialRootStore } from '@/models';
import { observer } from 'mobx-react-lite';
import { useCustomFonts } from '@/hooks/useCustomFonts';
import { GestureHandlerRootView } from 'react-native-gesture-handler';
import { useScreenDimensions } from '@/hooks/useScreenDimensions';
import { isRunningInExpoGo } from 'expo';

// Construct a new instrumentation instance. This is needed to communicate between the integration and React
const routingInstrumentation = new Sentry.ReactNavigationInstrumentation({
  enableTimeToInitialDisplay: true,
});

Sentry.init({
  dsn: 'https://bc3d5cd12ec7666f26b6f8ea01941d82@o4507362238988288.ingest.de.sentry.io/4507362242854992',
  debug: true,
  integrations: [
    new Sentry.ReactNativeTracing({
      // Pass instrumentation to be used as `routingInstrumentation`
      routingInstrumentation,
      enableNativeFramesTracking: !isRunningInExpoGo(),
    }),
  ],
  tracesSampleRate: 1.0,
})

// Prevent the splash screen from auto-hiding before asset loading is complete.
SplashScreen.preventAutoHideAsync();

const RootLayout = observer(function RootLayout() {
  const { rehydrated } = useInitialRootStore(() => { });
  const [measured, _] = useScreenDimensions()
  const [loaded, fontLoadingError] = useCustomFonts();

  // Capture the NavigationContainer ref and register it with the instrumentation.
  const ref = useNavigationContainerRef();

  useEffect(() => {
    if (ref) {
      routingInstrumentation.registerNavigationContainer(ref);
    }
  }, [ref]);

  useEffect(() => {
    if (loaded && rehydrated && measured) {
      SplashScreen.hideAsync();
    }
  }, [loaded, rehydrated, measured]);
  if (!loaded || !rehydrated || !measured) {
    return null;
  }
  return (
    <GestureHandlerRootView>
      <Stack
        screenOptions={{
          gestureEnabled: false,
        }}
      >
        <Stack.Screen name="(tabs)" options={{ headerShown: false }} />
        <Stack.Screen name="+not-found" />
      </Stack>
    </GestureHandlerRootView>
  );
})

export default Sentry.wrap(RootLayout)

I have the following issue:

Since my last Expo-update from expo@51.0.32 -> 51.0.37 & @sentry/react-native@5.22.0 -> 5.24.3 I am consistently getting the warning " WARN Sentry Logger [warn]: [ReactNativeTracing] Not instrumenting App Start because this start was already reported." after each reload from Android and iOS. I have attached the entire Sentry log as file. The Sentry initialization code was not changed and I cannot find any deviations from the Sentry doc recommendations. There is only a single Sentry.init() in the project. Any ideas where the warning comes from and how to fix it?

Thanks in advance!

sentry_log.txt

@rwachtler
Copy link

rwachtler commented Oct 10, 2024

Hey @DrStoop and thanks for reaching out here! It looks like this [warn] log has been added intentionally by the team in 5.23.1 with following in mind:

This will makes it easier for our customer to see why their transactions are missing app start spans as well for us when debugging the SDK.

(source)

As stated in the PR, those will only appear if debug: true is set.
I assume that in your case no action is needed, since the warning just provides you the info that no new transaction will be created for app-start, because the app-start already has been already instrumented earlier. But just to be sure, do you still see app start span within a (initial/starting) transaction in your Sentry dashboard?


Sort of related --> https://github.com/getsentry/sentry-react-native/blob/main/CHANGELOG.md#5240

@DrStoop
Copy link
Author

DrStoop commented Oct 11, 2024

Thanks @rwachtler, no needed action is the best action! I'm new to Sentry and still on the Developer Plan, so I haven't got access to a Dashboard, yet. But I found a app.start.cold in performance of the index (ui.load) screen which might be it, see screenshot below. Thx again...

Image

@rwachtler
Copy link

rwachtler commented Oct 12, 2024

so I haven't got access to a Dashboard, yet

Oh, sorry, I was referring to the general Sentry dashboard, not the "Dashboards" feature 😅

Given your screenshot, it looks like this is the span operation you see. So in terms of measurement trigger, it looks fine to me. The only thing which is a bit odd - the recorded duration of the first two events with 35.36s and 26.62s. The third event with 5.43s seems to be "ok" though. 🤔

@DrStoop
Copy link
Author

DrStoop commented Oct 13, 2024

Thanks for noticing, the long duration might have happened while I was messing around with the splash screen show times and initialization hooks in the development build. It's down to < 1sec in the preview build (see screenshot). But I might also be missing something - time will tell 🥸

Cold App Start
Image

*Span Overview"
Image

@rwachtler
Copy link

@krystofwoldrich sorry for direct ping, do you think this issue can be closed? IMO there is no further resolution needed, or is it required that the issue creator marks it as "Closed"?

@krystofwoldrich
Copy link
Member

@rwachtler No worries. Thank you for helping to @DrStoop.

@DrStoop
Copy link
Author

DrStoop commented Oct 16, 2024

thanks more! :)

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

3 participants