sentry-dotnet
sentry-dotnet copied to clipboard
Remove 'Platform' from scope
Problem Statement
SentryEvents get the Platform property already set in the internal Constructor https://github.com/getsentry/sentry-dotnet/blob/def623108063996cd86facb3bef43998cb2b8867/src/Sentry/SentryEvent.cs#L205 and the scope does not override it when it gets applied https://github.com/getsentry/sentry-dotnet/blob/def623108063996cd86facb3bef43998cb2b8867/src/Sentry/Scope.cs#L363 Does this mean setting the Platform when configuring the scope doesn't do anything?
Solution Brainstorm
We might as well remove the 'Platform' from the scope.
platform should be always csharp
(even if code was written in VB or F#) so makes sense to get rid of it
platform should be always
csharp
Yeah, probably it should have been called dotnet
, but effectively it's the same for this purpose.
Though after reading the spec for stack traces, I believe we still need to let platform be set on a stack trace/frame so that we can override it if we bundle native SDKs in the future.
We were wrong about this. The platform name won't always be "csharp"
. With the new Android support, if an event is generated from the embedded Android SDK, its platform will be "java"
. This would be evident on events exposed in a BeforeSend
delegate. We shouldn't obsolete the property or remove it, as that will erroneously change the platform from "java"
to "csharp"
when roundtripping.
I'll revert the change.
The protocol should allow different values to match the use case Matt described. But I believe there's still no need for Platform on the Scope though. So we could remove it from the scope.