sentry-unity
sentry-unity copied to clipboard
Transactions have the wrong SDK name
Transactions send from the Unity SDK are reported as .NET's:

One idea that came up on a call:
- Sentry SDK for .NET gets a compiler flag (
SENTRY_UNITY). SentryOptions.csbecomes a partial class.SentryOptions.Unity.csis introduced guarded by the compiler flag.- Properties for the SDK name and version added to the Unity version of SentryOptions
- Sentry.Unity SDK can set the version when calling
SentrySdk.Init(or set to itself asSentryUnityOptionsderive fromSentryOptions). - Locations where we set Sdk.name/version (i.e: EventProcessor) guarded by the compiler flag will use that value instead
Before we take the approach suggested above, additional context. The way we define sdk.name in all .NET SDK integrations are done like:
https://github.com/getsentry/sentry-dotnet/blob/4df4d0f02b3d4031d4a84ea48e6842b35a9c3d9b/src/Sentry.Google.Cloud.Functions/SentryStartup.cs#L88-L100
We used that same approach here too:
https://github.com/getsentry/sentry-unity/blob/9f4df8d5f5e625ad0b243fd751773e60519444f7/src/Sentry.Unity/UnityEventProcessor.cs#L59-L60
The issue, is that we don't run EventProcessors on Transactions. There's a card on the 4.0 .NET SDK project to add it.
On the Java SDK, we used default interface methods to avoid the breaking change and we added it. https://github.com/getsentry/sentry-java/blob/32e9d94a5eca8c0452855cf6b22e2f7288eec9ce/sentry/src/main/java/io/sentry/EventProcessor.java#L32-L34
In other SDKs, there's no type distinction between SentryEvent and SentryTransaction (a transaction is an event with type=transaction so it just goes through the same event processor).
So, we want it to read sentry.dotnet.unity, for Unity. We're missing the mechanism to change the underlying value. Event Processors for transactions getsentry/sentry-dotnet#1468 could help with this.
setting this as "blocked" until the support is available in sentry-dotnet
might require https://github.com/getsentry/sentry-dotnet/issues/1468