-
-
Notifications
You must be signed in to change notification settings - Fork 55
feat: Propagate traceId
to the Cocoa SDK
#2106
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
Conversation
|
@@ -255,6 +274,22 @@ void SentryNativeBridgeUnsetUser() | |||
return cString; | |||
} | |||
|
|||
void SentryNativeBridgeSetTrace(const char *traceId, const char *spanId) |
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.
is the iOS and Mac bridges the same? I wonder if we could use symlinks
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.
Unfortunately, they are not. Functionally, yes, but we load the lib dynamically on macOS:
sentry-unity/package-dev/Plugins/macOS/SentryNativeBridge.m
Lines 97 to 105 in 16e21d8
/*******************************************************************************/ | |
/* The remaining code is a copy of iOS/SentryNativeBridge.m with changes to */ | |
/* make it work with dynamically loaded classes. Mainly: */ | |
/* - call: [class performSelector:@selector(arg1:arg2:) */ | |
/* withObject:arg1Value withObject:arg2Value]; */ | |
/* or xCode warns of class/instance method not found */ | |
/* - use `id` as variable types */ | |
/* - use [obj setValue:value forKey:@"prop"] instead of `obj.prop = value` */ | |
/*******************************************************************************/ |
With this change the Unity SDK is propagating the trace down to the Cocoa SDK. This allows connecting native errors and crashes with the ones from within the game.
Relies on getsentry/sentry-cocoa#5081