-
-
Notifications
You must be signed in to change notification settings - Fork 200
Description
Description
Hello!
TLDR: We are unable to use sentry-native to set up custom Sentry Tracing for Android. Would really appreciate some information and context as to whether or not this is expected.
I recently did some work to set up custom instrumentation for the Sentry Tracing feature. Our project supports multiple platforms, one of which is Android.
I initially tried to use sentry-native to set up Android custom instrumentation. I verified that the sample rate was set to 100% in my Android project. I also confirmed via breakpoints that all the necessary methods for Sentry Tracing are being called when expected. However, no Sentry transactions are sent from Android when using sentry-native.
Upon further investigation, we discovered a log line that seems related:
sentry-native com.mypackage I throwing away transaction due to sample rate or user-provided sampling value in transaction context
It appears that there may be a bug with sentry-native that does not respect the sample rate set for Android. Using the native SDK for our desktop platforms works great, so this seems to be an Android-specific issue. We are also able to use features such as Crash Reporting with Android using sentry-native, so it's perplexing that Tracing does not also work.
It would be great to be able to use sentry-native for this purpose to avoid unnecessary bridging. Any context or info you might be able to provide on this issue would be greatly appreciated.
When does the problem happen
- During build
- During run-time
- When capturing a hard crash
Environment
- OS: Android
- IDE: Android Studio
Steps To Reproduce
The setup is more involved than just a code snippet, but we followed the instructions pretty much exactly for setting up custom instrumentation for the native SDK. We are also setting the sample rate in our Android project in the AndroidManifest.xml:
<meta-data android:name="io.sentry.traces.sample-rate" android:value="1.0" />
We also tried setting it through our C++ code, but this did not work either.
Log output
I can provide other logs if needed, but this appears to be the most relevant log line when trying to run Android Sentry Tracing with sentry-native:
sentry-native com.mypackage I throwing away transaction due to sample rate or user-provided sampling value in transaction context
Metadata
Metadata
Assignees
Projects
Status
Status