sentry-unity icon indicating copy to clipboard operation
sentry-unity copied to clipboard

Transactions have the wrong SDK name

Open bruno-garcia opened this issue 3 years ago • 5 comments

Transactions send from the Unity SDK are reported as .NET's:

image

bruno-garcia avatar Nov 29 '21 15:11 bruno-garcia

One idea that came up on a call:

  • Sentry SDK for .NET gets a compiler flag (SENTRY_UNITY).
  • SentryOptions.cs becomes a partial class.
  • SentryOptions.Unity.cs is 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 as SentryUnityOptions derive from SentryOptions).
  • Locations where we set Sdk.name/version (i.e: EventProcessor) guarded by the compiler flag will use that value instead

bruno-garcia avatar Dec 07 '21 19:12 bruno-garcia

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).

bruno-garcia avatar Dec 14 '21 19:12 bruno-garcia

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.

mattjohnsonpint avatar Mar 16 '22 18:03 mattjohnsonpint

setting this as "blocked" until the support is available in sentry-dotnet

vaind avatar May 27 '22 15:05 vaind

might require https://github.com/getsentry/sentry-dotnet/issues/1468

SimonCropp avatar Jun 15 '22 21:06 SimonCropp