-
-
Notifications
You must be signed in to change notification settings - Fork 1
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
Hybrid SDKs should set the sentryClientName
on Native SDKs during SDK init.
#48
Comments
iOS already have this option exposed in the `PrivateSentrySDKOnly' class. + (void)setSdkName:(NSString *)sdkName andVersionString:(NSString *)versionString; |
Are you sure this field is being used for the HTTP request metadata and not only for the |
Yes! |
Consider the fact that this makes sense if the events are captured in the Hybrid SDKs, but if the Native SDK is capturing the events themselves, they should still keep the original |
We should set the |
@marandaneto, isn't this what we are doing here: Maybe I didn't get your last comment. |
It is, but the Hybrid SDKs don't overwrite this value yet. |
@krystofwoldrich @mattjohnsonpint create an issue for your next major in case it's needed. |
It seems there are three places where SDK name and version get sent to Sentry.
It also seems that all are optional. It would be good to have a better understanding of which should be sent. Perhaps all three? Also, in the case of hybrid SDKs, what name values should we use? I'll use .NET as an example, but I think we should standardize. The This is what I currently have:
In thinking about this, I'm not sure that I should actually have I don't currently change the name of either the embedded native SDKs. If I did, would it be something like There seem to be two concerns in general with regard to name:
So... Say I set |
So the goal of this is to always report as the top layer SDK? In the case of React Native, it would be always |
Better to confirm with @bruno-garcia Relay folks log the Pay attention that the event metrics would go up/down with this change, which was fine after consulting folks.
|
FYI, for Android, For iOS, |
After a side discussion with @bruno-garcia - I think I see what happened here. This issue was originally only about the So perhaps for Android, For iOS, I don't see anything other than |
SDK docs update about the naming convention. |
@mattjohnsonpint do we need to raise an issue for MAUI/etc for changing the SDK name for https://github.com/getsentry/sentry-native ? |
@kahest can you check Capacitor? I guess it's not either, not sure if we want to anyway. |
Maui doesn't use sentry-native directly. It does use sentry-cocoa (ios) or sentry-java (android) and sets the SDK names for both. Is there some setting on each of those to change the native sdk name that they bring in? I didn't think we needed to go more than one layer deep, no? |
When initialziing the SDK on Android you can change the Native SDK name by doing |
That gives us better stats of events, otherwise, Native events (C/C++) on Android running MAUI etc will be counted as not coming from a .NET environment. |
OK. Easy enough. Is there a similar option for Cocoa? |
|
Right, but that's for the Cocoa SDK name. We set that to That's similar to how in Android we set Looking closer, I don't think the Cocoa SDK is using the Sentry Native SDK, so there's no equivalent of |
That is correct, Sentry-Native is Android only, and Sentry Cocoa does not embed any other SDK. |
The reason is that
sentryClientName
is logged out by Relay when there are errors.For Hybrid SDKs, this is going to be always the Native SDKs because they are the ones sending the event over the wire.
Ideally, the Hybrid SDKs overwrite this value so when there's errors, it's logged out as the Hybrid SDK itself instead of eg Android or iOS.
The other benefit is that we can collect event metrics per SDK (Native events on an RN app will be counted as RN and not Native anymore).
Another option is that Relay logs the
event.sdk
instead of theUSER_AGENT
orsentry_client
from theauthHeader
.Android already has the
SentryOptions#setSentryClientName
, iOS to be confirmed, likely needs to be exposed in thePrivateSentrySDKOnly
class, @brustolin can you confirm?Tasks
sentry_client
on Native SDKs sentry-dart#1185setNativeClientName
for Hybrid SDKs sentry-java#2678The text was updated successfully, but these errors were encountered: