Performance monitoring (Custom Instrumentation) logs are not sent on Android
See original GitHub issueOS:
- Windows
- MacOS
- Linux
Platform:
- iOS
- Android
SDK:
-
@sentry/react-native
(>= 1.0.0) -
react-native-sentry
(<= 0.43.2)
SDK version: 4.11.0
react-native
version: 0.70.6
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
)
Sentry.init({
dsn: 'https://...@sentry.io/...'
tracesSampleRate: 1.0, // send transaction always
});
I have following issue:
Performance monitoring (Custom Instrumentation) logs are not sent on Android
Steps to reproduce:
- Step 1
- Create new React Native project with
npx react-native init SampleApp
- Create new React Native project with
- Step 2
- Setup sentry according to the document
yarn add @sentry/react-native
npx @sentry/wizard -i reactNative -p ios android
- Setup sentry according to the document
- Step 3
- Setup Performance Monitoring according to the document
import * as Sentry from "@sentry/react-native";
Sentry.init({
dsn: "https://...",
tracesSampleRate: 1.0
});
const App: () => Node = () => {
useEffect(() => {
const transaction = Sentry.startTransaction({name: 'test-transaction'});
const span = transaction.startChild({op: 'functionX'});
// functionCallX
span.finish();
transaction.finish();
}, []);
...
}
- Step 4
- Check Performance Monitoring at Sentry.io
Actual result:
-
❌ When I run Custom Instrumentation on Android, I cannot see any logs on sentry.io.
-
✅ No problem with Automatic Instrumentation.
-
✅ No problem with iOS.
-
✅ No problem with sentry-react-native v3.4.3. Seems to be a problem with v4 and above.
sentry-react-native | Instrumentation | iOS | Android |
---|---|---|---|
v4.11.0 | Automatic Instrumentation | ✅ | ✅ |
Custom Instrumentation | ✅ | ❌ | |
v3.4.3 | Automatic Instrumentation | ✅ | ✅ |
Custom Instrumentation | ✅ | ✅ |
Expected result:
Custom Instrumentation performance logs to be sent by Android.
Issue Analytics
- State:
- Created 9 months ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Performance Monitoring troubleshooting and FAQ - Firebase
If you're not seeing log messages for performance events, try the following troubleshooting steps: Make sure that the Performance Monitoring SDK is not...
Read more >Troubleshoot the Android Instrumentation
To ensure that it is not actually instrumenting, run gradle with --info flag to show the info logs. You should see the following...
Read more >Slow rendering - Android Developers
With custom performance monitoring To do this, collect frame render times from specific parts of your app with FrameMetricsAggregator and ...
Read more >Add custom data to mobile monitoring
For New Relic's mobile monitoring: learn how to send custom data, and which ... create your own data types for custom instrumentation for...
Read more >Set Up for Android - Sentry Documentation
Profiling depends on Sentry's performance monitoring product being enabled beforehand ... is not sending performance data, try using custom instrumentation.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@krystofwoldrich @marandaneto Thank you for the support! Transaction appeared in Sentry by adding
op
. 🎉@takahi5 The logs look good. Seems like the SDK is sending the data.
Do you maybe have dynamic sampling enabled in the Sentry UI?
Can you also check
Logcat
, I suspect you will see the following.@takahi5 You can try to add
op
and the transaction should appear in Sentry.@markushi @romtsn ~Was
op
always required on Android or is it some recent change?~ I see it’s from6.0.0-alpha.1