Profiling and Mobile Vitals (insights) not working on latest version of react native sdk
What React Native libraries do you use?
React Native without Frameworks, React Navigation, Hermes, RN New Architecture
Are you using sentry.io or on-premise?
sentry.io (SaS)
@sentry/react-native SDK Version
6.10.0
How does your development environment look like?
System:
OS: macOS 15.4
CPU: (12) arm64 Apple M2 Pro
Memory: 273.41 MB / 32.00 GB
Shell:
version: "5.9"
path: /bin/zsh
Binaries:
Node:
version: 20.17.0
path: ~/.asdf/installs/nodejs/20.17.0/bin/node
Yarn: Not Found
npm:
version: 11.3.0
path: ~/.asdf/plugins/nodejs/shims/npm
Watchman:
version: 2025.03.10.00
path: /opt/homebrew/bin/watchman
Managers:
CocoaPods:
version: 1.15.2
path: /Users/ricardosanchez/.asdf/shims/pod
SDKs:
iOS SDK:
Platforms:
- DriverKit 24.2
- iOS 18.2
- macOS 15.2
- tvOS 18.2
- visionOS 2.2
- watchOS 11.2
Android SDK:
API Levels:
- "28"
- "31"
- "33"
- "34"
- "35"
Build Tools:
- 30.0.3
- 31.0.0
- 33.0.0
- 33.0.1
- 33.0.2
- 34.0.0
- 34.0.0
- 34.0.0
- 34.0.0
- 35.0.0
- 35.0.0
System Images:
- android-33 | Google APIs ARM 64 v8a
- android-33 | Google Play ARM 64 v8a
- android-34 | Google APIs ARM 64 v8a
- android-35 | Google Play ARM 64 v8a
Android NDK: Not Found
IDEs:
Android Studio: 2024.3 AI-243.22562.218.2431.13114758
Xcode:
version: 16.2/16C5032a
path: /usr/bin/xcodebuild
Languages:
Java:
version: 17.0.14
path: /opt/homebrew/opt/openjdk@17/bin/javac
Ruby:
version: 2.7.6
path: /Users/ricardosanchez/.asdf/shims/ruby
npmPackages:
"@react-native-community/cli":
installed: 15.1.3
wanted: ^15.0.0
react:
installed: 18.3.1
wanted: 18.3.1
react-native:
installed: 0.76.7
wanted: ^0.76.0
react-native-macos: Not Found
npmGlobalPackages:
"*react-native*": Not Found
Android:
hermesEnabled: true
newArchEnabled: true
iOS:
hermesEnabled: true
newArchEnabled: true
info React Native v0.79.1 is now available (your project is running on v0.76.7).
info Changelog: https://github.com/facebook/react-native/releases/tag/v0.79.1
info Diff: https://react-native-community.github.io/upgrade-helper/?from=0.76.7&to=0.79.1
info For more info, check out "https://reactnative.dev/docs/upgrading?os=macos".
Sentry.init()
const navigationIntegration = Sentry.reactNavigationIntegration({
enableTimeToInitialDisplay: true,
})
// Sentry integrations
const mobileReplayIntegration = Sentry.mobileReplayIntegration({
maskAllText: false,
})
Sentry.init({
dsn: currentConfig.sentry.dsn,
environment: currentEnvironment,
tracesSampleRate: 1.0,
profilesSampleRate: 1.0,
replaysSessionSampleRate: 1.0,
replaysOnErrorSampleRate: 1.0,
integrations: [
Sentry.reactNativeTracingIntegration(),
mobileReplayIntegration,
navigationIntegration,
],
})
Steps to Reproduce
- Add sentry init as mentioned above
- add the following to
'@react-navigation/native''s<NaviogationContainer>:
navigationIntegration.registerNavigationContainer(NAVIGATION_REF)
- Install the app on physical devices
- Replays and general errors are working as expected
- Expects vitals and profiling info on Sentry Dashboard
Expected Result
Mobile vitals should be send to Sentry Dashboard, as for testing we are setting the tracesSampleRate and profilesSampleRate, replaysSessionSampleRate, and replaysOnErrorSampleRate to 1.0.
Actual Result
- Only Replays and general error are being reportes
Hi,
thank you for the message,
can you add debug: true to you Sentry.init and share the log with us.
Hey @krystofwoldrich, I had someone reach out noticing the same problem, they're unable to populate mobile vitals page using the latest sdk version and a basic tracing setup, https://sentry.zendesk.com/agent/tickets/151608. I made a repo to test this out a bit, and followed our routing instrumentation and cannot seem to get my mobile vitals page working with navigation setup - no ui.load spans get captured, instead the transactions just get discarded. In my logs, I am seeing βSentry Logger [log]: [Tracing] Discarding transaction because its trace was not chosen to be sampledβ.
@coby.eastwood thanks for the update and the repro, we'll take a look and follow up here. FYI @antonis @markushi
I made a repo to test this out a bit
Thank you for the repo @cobyeastwood183 π We were able to reproduce the issue and we will iterate back.
What is the status of this one?
What is the status of this one?
Thank you for the ping @bvedad π Weβre still investigating this issue. If you have a configuration that reproduces it, please feel free to share it β it would be a big help.
@antonis When can we get an update on this issue?
Considering this is one of the major features of Sentry and it's pending for quite some time.
Thank you for the ping @saxenanickk π
In most cases this issue and the Discarding transaction because its trace was not chosen to be sampled error log seem to be related to the way the navigation container is being registered. If you have a configuration that reproduces it, please feel free to share it β it would be a big help.
Thank you for the ping @saxenanickk π In most cases this issue and the
Discarding transaction because its trace was not chosen to be samplederror log seem to be related to the way the navigation container is being registered. If you have a configuration that reproduces it, please feel free to share it β it would be a big help.
@antonis I have following setup:
"@sentry/react-native": "6.4.0",
---
export const navigationIntegration = Sentry.reactNavigationIntegration({
enableTimeToInitialDisplay: true,
});
---
Sentry.init({
dsn: SENTRY_DSN,
debug: true, // for testing
normalizeDepth: 5,
// Tracking
enableAutoSessionTracking: true,
enableUserInteractionTracing: true,
enableAppHangTracking: true,
sessionTrackingIntervalMillis: 60000,
appHangTimeoutInterval: 5,
// Integrations
integrations: [
navigationIntegration,
Sentry.httpClientIntegration(),
Sentry.reactNativeTracingIntegration({
enableHTTPTimings: true,
}),
],
// Sampling
profilesSampleRate: 1.0, // for testing only, 0.0. on production
tracesSampleRate: 1.0, // for testing only, 0.05 on production
});
---
<NavigationContainer
ref={navigationRef}
onReady={() => {
handleAppStateReady();
navigationIntegration.registerNavigationContainer(navigationRef);
}}
>
Thank you for the feedback @saxenanickk π
Is there any update on this @antonis? We are still facing the same issue.
Thank you for the ping @sethraj14. We are still investigating this.
I got the same issue :/
I've got the same issue :(
Thank you for bumping this @ssarnot π Could you share the your @sentry/react-native SDK Version and your configuration?
@antonis
@sentry/react-native is 7.2.0 and configuration is:
JS engine: hermes
Expo SDK version: 54.0.0
React-native version: 0.81.5
Sentry init in App.js file:
import { init } from "@sentry/react-native";
init({
dsn: "XXX",
debug: false,
sendDefaultPii: true,
environment: effectiveEnvironment,
attachScreenshot: false,
tracesSampleRate: 0.5,
profilesSampleRate: 0.5,
integrations: [reactNativeTracingIntegration(), navigationIntegration],
enableNativeFramesTracking: true,
enableAutoSessionTracking: true,
enableAutoPerformanceTracing: true,
});
Thank you π