-
Notifications
You must be signed in to change notification settings - Fork 4
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(react-native): support for starting native spans on android #536
feat(react-native): support for starting native spans on android #536
Conversation
Browser bundle sizeNPM build
CDN build
Code coverageCoverage values did not change👌. Total:
Generated against a9097cf on 2 December 2024 at 14:05:00 UTC |
39925f3
to
dec156d
Compare
...tive/android/src/main/java/com/bugsnag/android/performance/NativeBugsnagPerformanceImpl.java
Outdated
Show resolved
Hide resolved
long nativeSpanId = Long.parseUnsignedLong(spanId, 16); | ||
UUID nativeTraceId = new UUID(Long.parseUnsignedLong(traceId.substring(0, 16), 16), Long.parseUnsignedLong(traceId.substring(16), 16)); | ||
|
||
SpanContext nativeSpanContext = new SpanContext() { |
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.
Any reason this shouldn't maybe be a named class (like ReactNativeSpanContext
) to remove the noise from this jsSpanContextToNativeSpanContext
?
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.
good idea 👍🏾
8d55f2c
to
63f5c9b
Compare
...tive/android/src/main/java/com/bugsnag/android/performance/NativeBugsnagPerformanceImpl.java
Show resolved
Hide resolved
nativeSpanId = Long.parseUnsignedLong(spanId, 16); | ||
nativeTraceId = new UUID( | ||
Long.parseUnsignedLong(traceId.substring(0, 16), 16), | ||
Long.parseUnsignedLong(traceId.substring(16), 16) | ||
); |
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.
It feels like 16
for the radix should maybe be made into a constant?
private static final int HEX_RADIX = 16;
It might also be worth it to have a TRACE_ID_MIDPOINT = 16
constant
...act-native/android/src/main/java/com/bugsnag/android/performance/ReactNativeSpanContext.java
Outdated
Show resolved
Hide resolved
63f5c9b
to
42f08bd
Compare
42f08bd
to
1b8f00e
Compare
a2b57b6
to
a9097cf
Compare
ab5a293
into
integration/rn-native-integration
Goal
Add support for starting native spans on Android
Design
Added a new Turbo Module method called
startNativeSpan
which creates a span in the Android Performance SDK and returns a JS representation of the native Android span to JS.The Turbo Module method accepts a limited set of span options (
startTime
andparentContext
) as native spans should always be first class and should never become the current context in the native SDK.Testing
Tested manually as this is not yet being used