-
-
Notifications
You must be signed in to change notification settings - Fork 239
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
Bugfix: add-sample-rate-native #2200
base: main
Are you sure you want to change the base?
Conversation
I checked "No breaking changes" since I think this is not breaking. However, the sdk might behave differently but I would say its no the correct expected behavior. |
hey, do you use the native sdk alongside the flutter sdk? |
I'm trying to find the context as to why this was not added before. It's hard to imagine that this was just an oversight but it could be. |
Example: our react native SDK also doesn't set the sample rates during init: https://github.com/getsentry/sentry-react-native/blob/979a258538e6b140d912f7d74b89f684c504b67f/android/src/main/java/io/sentry/react/RNSentryModuleImpl.java#L182 |
@buenaflor I was also suprised, but my assumption was that nobody found this since most react native and flutter developers are interested in the errors that are thrown in the TS or Dart code and the native exceptions are very rare. I wasn't sure if there is some kind of magic initialization that I was missing so take your time with reviewing this. |
After some discussion I don't think this should be added since there's the possibility of double instrumentation since the native sdks themselves have instrumentation for certain integrations. For example the cocoa sdk has all these automatic instrumentation which might result in duplicate data being sent. In terms of feature set and design we also want to keep our hybrid sdks as consistent as possible to one another. So adding this change brings a lot of implications and is actually a rather big decision. |
@buenaflor |
@JulianBissekkou if we pass here is what we should do: I agree that |
flutter/android/src/main/kotlin/io/sentry/flutter/SentryFlutter.kt
Outdated
Show resolved
Hide resolved
…r.kt Co-authored-by: Giancarlo Buenaflor <[email protected]>
Co-authored-by: Giancarlo Buenaflor <[email protected]>
@buenaflor Thanks for explaining. |
Co-authored-by: Giancarlo Buenaflor <[email protected]>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2200 +/- ##
==========================================
+ Coverage 88.03% 90.72% +2.68%
==========================================
Files 247 73 -174
Lines 8585 2371 -6214
==========================================
- Hits 7558 2151 -5407
+ Misses 1027 220 -807 ☔ View full report in Codecov by Sentry. |
@JulianBissekkou some tests are failing but it should be a very simple fix (you can ignore the danger ci) also could you add this changelog entry under
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for contributing!
- Please also add tests for the new values our native tests
SentryFlutterTests.swift
andSentryFlutterTest.kt
. - Update the test expectations in
init_native_sdk_test.dart
to include the new value
I will make this PR ready later this week :) Thanks for your feedback |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, only issue left is a linting issue in the Kotlin file:
SentryFlutterTest.kt:162:28: error: Missing trailing comma before ")"
📜 Description
During development I discovered that the sample rate is not correctly forwarded to the native sdks.
💡 Motivation and Context
This PR makes sure that initialization of the native sdks also uses the configured sampleRate and traceSampleRate from the FlutterSentryOptions.
💚 How did you test it?
I tested this by setting a breakpoint and ensuring that my configuration was applied to the native options. If there is a better way, let me know :)
📝 Checklist
sendDefaultPii
is enabled🔮 Next steps