-
-
Notifications
You must be signed in to change notification settings - Fork 185
feat(ndk): add traces_sample_rate
synchronization
#1176
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
feat(ndk): add traces_sample_rate
synchronization
#1176
Conversation
Instructions and example for changelogPlease add an entry to Example: ## Unreleased
- add `traces_sample_rate` synchronization ([#1176](https://github.com/getsentry/sentry-native/pull/1176)) If none of the above apply, you can opt out of this check by adding |
@@ -22,4 +22,29 @@ JNIEXPORT void JNICALL Java_io_sentry_ndk_sample_NdkSample_message(JNIEnv *env, | |||
sentry_capture_event(event); | |||
} | |||
|
|||
JNIEXPORT void JNICALL Java_io_sentry_ndk_sample_NdkSample_transaction(JNIEnv *env, jclass cls) { |
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.
Since the NDK has no transport, we can't really test this just by looking at Sentry dashboards/intercepting HTTP. A way to check if the envelope is created properly, is by looking at data/data/io.sentry.ndk.sample/files/outbox
on the emulated device's storage.
This envelope-check is probably how we want to this test on the native repo (and then have a integration test similar to this one from native on the java-SDK side)
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.
Yeah, this is fine. The outbox
is the primary interface back to sentry-android
and, as such, the ideal test boundary. Adding additional machinery beyond parsing the output won't provide better feedback.
back to draft, forgot to change the new variable to getter-setter only (it should not be part of constructor) |
I'm not sure if there is a proper place to add this feature to the native docs, or if it makes more sense to only add it to the Android docs once we implement the feature to pass through the |
Currently, this doesn't require much documentation. The ask is primarily for sentry-native to honor the setting from the sentry-android layer. Most people would expect it just to work, and it only pops up because it doesn't. Of course, the core question remains: Do we think it should work? So, the getter/setter doesn't require attention from the docs. What should be documented, and probably on the Android side (but not necessarily by their team alone), is how transactions should work if enabled on both layers. This PR doesn't answer this since it only opens the pass-through down and back up (which is fine, but as such, it can't provide any clarifying insights either). |
* Add dependencies to allow running unit tests as well as instrumented android tests * add ndk test into CI * moved NDK check+test into `test` job * add conditional check for ANDROID_API in NDK test/check jobs * trying to fix CI * trying to fix CI 2 * Add Java/Gradle setup steps * Apply checks to NDK lib only * Apply code formatting * run tests on reactivecircus emulator * remove KVM enable step * update CI (remove NDK test) --------- Co-authored-by: Markus Hintersteiner <[email protected]>
9bf3c1a
to
f2cf32d
Compare
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.
Looking good, nice! I left a few minor/medium comments, just ping me as soon as I should take a second look 🚀
ndk/lib/src/androidTest/java/io/sentry/ndk/sample/NdkSample.java
Outdated
Show resolved
Hide resolved
ndk/lib/src/androidTest/java/io/sentry/ndk/sample/NdkSample.java
Outdated
Show resolved
Hide resolved
ndk/lib/src/androidTest/java/io/sentry/ndk/sample/NdkTestHelper.java
Outdated
Show resolved
Hide resolved
Co-authored-by: Mischan Toosarani-Hausberger <[email protected]>
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!
Fixes #1167
-> also have an integration test to make sure sending transactions works.
Since the NDK has no transport, we expect the Android side to pick up any envelopes (see this comment)