From 23f58caa6a9bda2dc76fec6d249a637a1e33df36 Mon Sep 17 00:00:00 2001 From: bitsandfoxes Date: Thu, 8 Feb 2024 11:23:44 +0100 Subject: [PATCH 1/8] updated migration guide to 4 --- docs/platforms/dotnet/migration/index.mdx | 132 ++++++++++++++++++++++ 1 file changed, 132 insertions(+) diff --git a/docs/platforms/dotnet/migration/index.mdx b/docs/platforms/dotnet/migration/index.mdx index 87933994e3f06..590f1e398f68d 100644 --- a/docs/platforms/dotnet/migration/index.mdx +++ b/docs/platforms/dotnet/migration/index.mdx @@ -6,6 +6,138 @@ sidebar_order: 8000 Upgrading includes both breaking changes and new features. +## Migrating to 4.0.0 + +### .NET target framework changes + +We're dropping support for some of the old target frameworks, please check this [GitHub Discussion](https://github.com/getsentry/sentry-dotnet/discussions/2776) for details on why. + +- Support for .NET Framework 4.6.1 has been replaced with 4.6.2 +
.NET Framework 4.6.1 was announced on Nov 30, 2015. And went out of support over a year ago, on Apr 26, 2022. +- Support for .NET Core 3.1 and .NET 5 has been dropped +- Support for netstandard2.0 for Sentry.AspNetCore has been dropped +- Support for .NET 6 on mobile (e.g: `net6.0-android`) has been replaced with .NET 7 +
.NET 6 on mobile has been out of support since May 2023 and with .NET 8, it's no longer possible to build .NET 6 Mobile specific targets. For that reason, we're moving the mobile-specific TFMs from `net6.0-platform` to `net7.0-platform`. Mobile apps still work on .NET 6 will pull the `Sentry` .NET 6, which offers the .NET-only features, without native/platform-specific bindings and SDKs. See [this ticket for more details](https://github.com/getsentry/sentry-dotnet/issues/2623). +- Support for MAUI Tizen has been dropped + +### Sentry Self-hosted Compatibility + +If you're using `sentry.io` this change does not affect you. +This SDK version is compatible with a self-hosted version of Sentry `22.12.0` or higher. If you are using an older version of [self-hosted Sentry](https://develop.sentry.dev/self-hosted/) (aka on-premise), you will need to [upgrade](https://develop.sentry.dev/self-hosted/releases/). + +### Significant change in behavior + +- Transaction names for ASP.NET Core are now consistently named `HTTP-VERB /path` (e.g. `GET /home`). Previously, the leading forward slash was missing for some endpoints. +- Setting `SentryOptions.Dsn` to `null` now throws `ArgumentNullException` during initialization. +- Enable `CaptureFailedRequests` by default +- Added `Sentry` namespace to global usings when `ImplicitUsings` is enabled +If you have conflicts, you can opt out by adding the following to your `csproj`: +``` + + false + +``` +- Transactions' spans are no longer automatically finished with the status `deadline_exceeded` by the transaction. This is now handled by the [Relay](https://github.com/getsentry/relay). + - Customers self hosting Sentry must use verion 22.12.0 or later +- The `User.IpAddress` is now set to `{{auto}}` by default, even when sendDefaultPII is disabled + - The "Prevent Storing of IP Addresses" option in the "Security & Privacy" project settings on sentry.io can be used to control this instead +- The `DiagnosticLogger` signature for `LogWarning` changed to take the `exception` as the first parameter. That way it no longer gets mixed up with the TArgs. + +### Breaking Changes + +#### Changed APIs + +- Class renamed `Sentry.User` to `Sentry.SentryUser` +- Class renamed `Sentry.Runtime` to `Sentry.SentryRuntime` +- Class renamed `Sentry.Span` to `Sentry.SentrySpan` +- Class renamed `Sentry.Transaction` to `Sentry.SentryTransaction` +- Class renamed `Sentry.Constants` to `Sentry.SentryConstants` +- Class renamed `Sentry.Context` to `Sentry.SentryContext` +- Class renamed `Sentry.Package` to `Sentry.SentryPackage` +- Class renamed `Sentry.Request` to `Sentry.SentryRequest` +- Class renamed `Sentry.` to `Sentry.SentryTransaction` +- Class renamed `Sentry.Session` to `Sentry.SentrySession` +- Class renamed `Sentry.Attachment` to `Sentry.SentryAttachment` +- Class renamed `Sentry.Hint` to `Sentry.SentryHint` +- Interface renamed `Sentry.ISession` to `Sentry.SentryISession` +- Interface renamed `Sentry.IJsonSerializable` to `Sentry.SentryIJsonSerializable` +- Interface renamed `Sentry.ITransaction` to `Sentry.ITransactionTracer`. +- Rename iOS and MacCatalyst platform-specific options from `Cocoa` to `Native` +- Rename iOS platform-specific options `EnableCocoaSdkTracing` to `EnableTracing` +- Rename Android platform-specific options from `Android` to `Native` +- Rename Android platform-specific options `EnableAndroidSdkTracing` and `EnableAndroidSdkBeforeSend` to `EnableTracing` and `EnableBeforeSend` respectively +- Rename iOS and MacCatalyst platform-specific options from `iOS` to `Cocoa` +- `DebugImage` and `DebugMeta` moved to `Sentry.Protocol` namespace. +- `SentryClient.Dispose` is no longer obsolete +- `ISentryClient.CaptureEvent` overloads have been replaced by a single method accepting optional `Hint` and `Scope` parameters. You will need to pass `hint` as a named parameter from code that calls `CaptureEvent` without passing a `scope` argument. +- `TransactionContext` and `SpanContext` constructors were updated. If you're constructing instances of these classes, you will need to adjust the order in which you pass parameters to these. +- The `DiagnosticLogger` signature for `LogError` and `LogFatal` changed to take the `exception` as the first parameter. That way it no longer gets mixed up with the TArgs. The `DiagnosticLogger` now also receives an overload for `LogError` and `LogFatal` that accepts a message only. +- `Distribution` added to `IEventLike`. +- `StackFrame`'s `ImageAddress`, `InstructionAddress`, and `FunctionId` changed to `long?`. +- `DebugImage.ImageAddress` changed to `long?`. +- Contexts now inherit from `IDictionary` rather than `ConcurrentDictionary`. The specific dictionary being used is an implementation detail. +- The method used to configure a Sentry Sink for Serilog now has an additional overload. Calling `WriteTo.Sentry()` with no arguments will no longer attempt to initialize the SDK (it has optional arguments to configure the behavior of the Sink only). If you want to initialize Sentry at the same time you configure the Sentry Sink then you will need to use the overload of this method that accepts a DSN as the first parameter (e.g. `WriteTo.Sentry("https://d4d82fc1c2c4032a83f3a29aa3a3aff@fake-sentry.io:65535/2147483647")`). + +#### Removed APIs + +- SentrySinkExtensions.ConfigureSentrySerilogOptions is now internal. If you were using this method, please use one of the `SentrySinkExtensions.Sentry` extension methods instead. +- A number of `[Obsolete]` options have been removed + - `BeforeSend` - use `SetBeforeSend` instead. + - `BeforeSendTransaction` - use `SetBeforeSendTransaction` instead. + - `BeforeBreadcrumb` - use `SetBeforeBreadcrumb` instead. + - `CreateHttpClientHandler` - use `CreateHttpMessageHandler` instead. + - `ReportAssemblies` - use `ReportAssembliesMode` instead. + - `KeepAggregateException` - this property is no longer used and has no replacement. + - `DisableTaskUnobservedTaskExceptionCapture` method has been renamed to `DisableUnobservedTaskExceptionCapture`. + - `DebugDiagnosticLogger` - use `TraceDiagnosticLogger` instead. +- A number of iOS/Android-specific `[Obsolete]` options have been removed + - `Distribution` - use `SentryOptions.Distribution` instead. + - `EnableAutoPerformanceTracking` - use `SetBeforeSendTransaction` instead. + - `EnableCoreDataTracking` - use `EnableCoreDataTracing` instead. + - `EnableFileIOTracking` - use `EnableFileIOTracing` instead. + - `EnableOutOfMemoryTracking` - use `EnableWatchdogTerminationTracking` instead. + - `EnableUIViewControllerTracking` - use `EnableUIViewControllerTracing` instead. + - `StitchAsyncCode` - no longer available. + - `ProfilingTracesInterval` - no longer available. + - `ProfilingEnabled` - use `ProfilesSampleRate` instead. +- Obsolete `SystemClock` constructor removed, use `SystemClock.Clock` instead. +- Obsolete `Runtime.Clone()` removed, this shouldn't have been public in the past and has no replacement. +- Obsolete `SentryException.Data` removed, use `SentryException.Mechanism.Data` instead. +- Obsolete `AssemblyExtensions` removed, this shouldn't have been public in the past and has no replacement. +- Obsolete `SentryDatabaseLogging.UseBreadcrumbs()` removed, it is called automatically and has no replacement. +- Obsolete `Scope.GetSpan()` removed, use `Span` property instead. +- Obsolete `IUserFactory` removed, use `ISentryUserFactory` instead. +- `IHasMeasurements` has been removed, use `ISpanData` instead. +- `IHasBreadcrumbs` has been removed, use `IEventLike` instead. +- `ISpanContext` has been removed, use `ITraceContext` instead. +- `IHasTransactionNameSource` has been removed, use `ITransactionContext` instead. +- The unused `StackFrame.InstructionOffset` has been removed. +- The unused `Scope.Platform` property has been removed. +- The obsolete setter `Sentry.PlatformAbstractions.Runtime.Identifier` has been removed +- `Sentry.Values` is now internal as it is never exposed in the public API +- The `TracePropagationTarget` class has been removed, use the `SubstringOrRegexPattern` class instead. +- The `WithScope` and `WithScopeAsync` methods have been removed. We have discovered that these methods didn't work correctly in certain desktop contexts, especially when using a global scope. +
Replace your usage of `WithScope` with overloads of `Capture*` methods: + - `SentrySdk.CaptureEvent(SentryEvent @event, Action scopeCallback)` + - `SentrySdk.CaptureMessage(string message, Action scopeCallback)` + - `SentrySdk.CaptureException(Exception exception, Action scopeCallback)` + + ```c# + // Before + SentrySdk.WithScope(scope => + { + scope.SetTag("key", "value"); + SentrySdk.CaptureEvent(new SentryEvent()); + }); + + // After + SentrySdk.CaptureEvent(new SentryEvent(), scope => + { + // Configure your scope here + scope.SetTag("key", "value"); + }); + ``` + ## Migrating to 3.12.0 ### NuGet Changes From 37660545e846c09d9bd50dc081bd3a9a0bcdf64c Mon Sep 17 00:00:00 2001 From: bitsandfoxes Date: Thu, 8 Feb 2024 11:25:08 +0100 Subject: [PATCH 2/8] . --- docs/platforms/dotnet/migration/index.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/platforms/dotnet/migration/index.mdx b/docs/platforms/dotnet/migration/index.mdx index 590f1e398f68d..ea608d3ca6ce3 100644 --- a/docs/platforms/dotnet/migration/index.mdx +++ b/docs/platforms/dotnet/migration/index.mdx @@ -6,7 +6,7 @@ sidebar_order: 8000 Upgrading includes both breaking changes and new features. -## Migrating to 4.0.0 +## Migrating to 4.x ### .NET target framework changes From b55d21dfe94ec3bed31948e506921086890c22ee Mon Sep 17 00:00:00 2001 From: Stefan Jandl Date: Mon, 12 Feb 2024 16:11:49 +0100 Subject: [PATCH 3/8] Apply suggestions from code review Co-authored-by: vivianyentran <20403606+vivianyentran@users.noreply.github.com> --- docs/platforms/dotnet/migration/index.mdx | 91 +++++++++++------------ 1 file changed, 45 insertions(+), 46 deletions(-) diff --git a/docs/platforms/dotnet/migration/index.mdx b/docs/platforms/dotnet/migration/index.mdx index ea608d3ca6ce3..25cca4ff2eb77 100644 --- a/docs/platforms/dotnet/migration/index.mdx +++ b/docs/platforms/dotnet/migration/index.mdx @@ -8,28 +8,27 @@ Upgrading includes both breaking changes and new features. ## Migrating to 4.x -### .NET target framework changes +### .NET Target Framework Changes -We're dropping support for some of the old target frameworks, please check this [GitHub Discussion](https://github.com/getsentry/sentry-dotnet/discussions/2776) for details on why. +We're dropping support for some of the old target frameworks. See this [GitHub Discussion](https://github.com/getsentry/sentry-dotnet/discussions/2776) for details on why. -- Support for .NET Framework 4.6.1 has been replaced with 4.6.2 -
.NET Framework 4.6.1 was announced on Nov 30, 2015. And went out of support over a year ago, on Apr 26, 2022. +- Support for .NET Framework 4.6.1 has been replaced with 4.6.2 because 4.6.1 went out of support in 2022. - Support for .NET Core 3.1 and .NET 5 has been dropped - Support for netstandard2.0 for Sentry.AspNetCore has been dropped - Support for .NET 6 on mobile (e.g: `net6.0-android`) has been replaced with .NET 7
.NET 6 on mobile has been out of support since May 2023 and with .NET 8, it's no longer possible to build .NET 6 Mobile specific targets. For that reason, we're moving the mobile-specific TFMs from `net6.0-platform` to `net7.0-platform`. Mobile apps still work on .NET 6 will pull the `Sentry` .NET 6, which offers the .NET-only features, without native/platform-specific bindings and SDKs. See [this ticket for more details](https://github.com/getsentry/sentry-dotnet/issues/2623). - Support for MAUI Tizen has been dropped -### Sentry Self-hosted Compatibility +### Sentry Self-Hosted Compatibility If you're using `sentry.io` this change does not affect you. This SDK version is compatible with a self-hosted version of Sentry `22.12.0` or higher. If you are using an older version of [self-hosted Sentry](https://develop.sentry.dev/self-hosted/) (aka on-premise), you will need to [upgrade](https://develop.sentry.dev/self-hosted/releases/). -### Significant change in behavior +### Significant Changes in Behavior - Transaction names for ASP.NET Core are now consistently named `HTTP-VERB /path` (e.g. `GET /home`). Previously, the leading forward slash was missing for some endpoints. - Setting `SentryOptions.Dsn` to `null` now throws `ArgumentNullException` during initialization. -- Enable `CaptureFailedRequests` by default +- `CaptureFailedRequests` is now enabled by default. - Added `Sentry` namespace to global usings when `ImplicitUsings` is enabled If you have conflicts, you can opt out by adding the following to your `csproj`: ``` @@ -37,60 +36,60 @@ If you have conflicts, you can opt out by adding the following to your `csproj`: false ``` -- Transactions' spans are no longer automatically finished with the status `deadline_exceeded` by the transaction. This is now handled by the [Relay](https://github.com/getsentry/relay). - - Customers self hosting Sentry must use verion 22.12.0 or later -- The `User.IpAddress` is now set to `{{auto}}` by default, even when sendDefaultPII is disabled - - The "Prevent Storing of IP Addresses" option in the "Security & Privacy" project settings on sentry.io can be used to control this instead -- The `DiagnosticLogger` signature for `LogWarning` changed to take the `exception` as the first parameter. That way it no longer gets mixed up with the TArgs. +- Transactions' spans are no longer automatically finished with the status `deadline_exceeded` by the transaction. This is now handled by [Relay](https://github.com/getsentry/relay). + - Customers self hosting Sentry must use version `22.12.0` or later +- The `User.IpAddress` is now set to `{{auto}}` by default, even when `sendDefaultPII` is disabled. + - To prevent sending IP addresses, use the "Prevent Storing of IP Addresses" option in the "Security & Privacy" project settings on sentry.io. +- The `DiagnosticLogger` signature for `LogWarning` now takes `exception` as the first parameter. This way, it no longer gets mixed up with `TArgs`. ### Breaking Changes #### Changed APIs -- Class renamed `Sentry.User` to `Sentry.SentryUser` -- Class renamed `Sentry.Runtime` to `Sentry.SentryRuntime` -- Class renamed `Sentry.Span` to `Sentry.SentrySpan` -- Class renamed `Sentry.Transaction` to `Sentry.SentryTransaction` -- Class renamed `Sentry.Constants` to `Sentry.SentryConstants` -- Class renamed `Sentry.Context` to `Sentry.SentryContext` -- Class renamed `Sentry.Package` to `Sentry.SentryPackage` -- Class renamed `Sentry.Request` to `Sentry.SentryRequest` -- Class renamed `Sentry.` to `Sentry.SentryTransaction` -- Class renamed `Sentry.Session` to `Sentry.SentrySession` -- Class renamed `Sentry.Attachment` to `Sentry.SentryAttachment` -- Class renamed `Sentry.Hint` to `Sentry.SentryHint` -- Interface renamed `Sentry.ISession` to `Sentry.SentryISession` -- Interface renamed `Sentry.IJsonSerializable` to `Sentry.SentryIJsonSerializable` -- Interface renamed `Sentry.ITransaction` to `Sentry.ITransactionTracer`. -- Rename iOS and MacCatalyst platform-specific options from `Cocoa` to `Native` -- Rename iOS platform-specific options `EnableCocoaSdkTracing` to `EnableTracing` -- Rename Android platform-specific options from `Android` to `Native` -- Rename Android platform-specific options `EnableAndroidSdkTracing` and `EnableAndroidSdkBeforeSend` to `EnableTracing` and `EnableBeforeSend` respectively -- Rename iOS and MacCatalyst platform-specific options from `iOS` to `Cocoa` +- Class renamed from `Sentry.User` to `Sentry.SentryUser`. +- Class renamed from `Sentry.Runtime` to `Sentry.SentryRuntime`. +- Class renamed from `Sentry.Span` to `Sentry.SentrySpan`. +- Class renamed from `Sentry.Transaction` to `Sentry.SentryTransaction`. +- Class renamed from `Sentry.Constants` to `Sentry.SentryConstants`. +- Class renamed from `Sentry.Context` to `Sentry.SentryContext`. +- Class renamed from `Sentry.Package` to `Sentry.SentryPackage`. +- Class renamed from `Sentry.Request` to `Sentry.SentryRequest`. +- Class renamed from `Sentry.` to `Sentry.SentryTransaction`. +- Class renamed from `Sentry.Session` to `Sentry.SentrySession`. +- Class renamed from `Sentry.Attachment` to `Sentry.SentryAttachment`. +- Class renamed from `Sentry.Hint` to `Sentry.SentryHint`. +- Interface renamed from `Sentry.ISession` to `Sentry.SentryISession`. +- Interface renamed from `Sentry.IJsonSerializable` to `Sentry.SentryIJsonSerializable`. +- Interface renamed from `Sentry.ITransaction` to `Sentry.ITransactionTracer`. +- iOS and MacCatalyst platform-specific options renamed from `Cocoa` to `Native`. +- iOS and MacCatalyst platform-specific options from `iOS` to `Cocoa`. +- iOS platform-specific options renamed from `EnableCocoaSdkTracing` to `EnableTracing`. +- Android platform-specific options renamed from `Android` to `Native`. +- Android platform-specific options renamed from `EnableAndroidSdkTracing` and `EnableAndroidSdkBeforeSend` to `EnableTracing` and `EnableBeforeSend` respectively. - `DebugImage` and `DebugMeta` moved to `Sentry.Protocol` namespace. -- `SentryClient.Dispose` is no longer obsolete +- `SentryClient.Dispose` is no longer obsolete. - `ISentryClient.CaptureEvent` overloads have been replaced by a single method accepting optional `Hint` and `Scope` parameters. You will need to pass `hint` as a named parameter from code that calls `CaptureEvent` without passing a `scope` argument. - `TransactionContext` and `SpanContext` constructors were updated. If you're constructing instances of these classes, you will need to adjust the order in which you pass parameters to these. -- The `DiagnosticLogger` signature for `LogError` and `LogFatal` changed to take the `exception` as the first parameter. That way it no longer gets mixed up with the TArgs. The `DiagnosticLogger` now also receives an overload for `LogError` and `LogFatal` that accepts a message only. +- The `DiagnosticLogger` signature for `LogError` and `LogFatal` now takes the `exception` as the first parameter. This way, it no longer gets mixed up with the `TArgs`. The `DiagnosticLogger` now also receives an overload for `LogError` and `LogFatal` that accepts a message only. - `Distribution` added to `IEventLike`. - `StackFrame`'s `ImageAddress`, `InstructionAddress`, and `FunctionId` changed to `long?`. - `DebugImage.ImageAddress` changed to `long?`. - Contexts now inherit from `IDictionary` rather than `ConcurrentDictionary`. The specific dictionary being used is an implementation detail. -- The method used to configure a Sentry Sink for Serilog now has an additional overload. Calling `WriteTo.Sentry()` with no arguments will no longer attempt to initialize the SDK (it has optional arguments to configure the behavior of the Sink only). If you want to initialize Sentry at the same time you configure the Sentry Sink then you will need to use the overload of this method that accepts a DSN as the first parameter (e.g. `WriteTo.Sentry("https://d4d82fc1c2c4032a83f3a29aa3a3aff@fake-sentry.io:65535/2147483647")`). +- The method used to configure a Sentry Sink for Serilog now has an additional overload. Calling `WriteTo.Sentry()` with no arguments will no longer attempt to initialize the SDK (it has optional arguments to configure the behavior of the Sink only). If you want to initialize Sentry at the same time you configure the Sentry Sink, then you will need to use the overload of this method that accepts a DSN as the first parameter (for example, `WriteTo.Sentry("https://d4d82fc1c2c4032a83f3a29aa3a3aff@fake-sentry.io:65535/2147483647")`). #### Removed APIs -- SentrySinkExtensions.ConfigureSentrySerilogOptions is now internal. If you were using this method, please use one of the `SentrySinkExtensions.Sentry` extension methods instead. -- A number of `[Obsolete]` options have been removed +- `SentrySinkExtensions.ConfigureSentrySerilogOptions` is now internal only. If you were using this method, please use one of the `SentrySinkExtensions.Sentry` extension methods instead. +- A number of `[Obsolete]` options have been removed: - `BeforeSend` - use `SetBeforeSend` instead. - `BeforeSendTransaction` - use `SetBeforeSendTransaction` instead. - `BeforeBreadcrumb` - use `SetBeforeBreadcrumb` instead. - `CreateHttpClientHandler` - use `CreateHttpMessageHandler` instead. - `ReportAssemblies` - use `ReportAssembliesMode` instead. - `KeepAggregateException` - this property is no longer used and has no replacement. - - `DisableTaskUnobservedTaskExceptionCapture` method has been renamed to `DisableUnobservedTaskExceptionCapture`. + - `DisableTaskUnobservedTaskExceptionCapture`- use `DisableUnobservedTaskExceptionCapture` instead. - `DebugDiagnosticLogger` - use `TraceDiagnosticLogger` instead. -- A number of iOS/Android-specific `[Obsolete]` options have been removed +- A number of iOS/Android-specific `[Obsolete]` options have been removed: - `Distribution` - use `SentryOptions.Distribution` instead. - `EnableAutoPerformanceTracking` - use `SetBeforeSendTransaction` instead. - `EnableCoreDataTracking` - use `EnableCoreDataTracing` instead. @@ -107,15 +106,15 @@ If you have conflicts, you can opt out by adding the following to your `csproj`: - Obsolete `SentryDatabaseLogging.UseBreadcrumbs()` removed, it is called automatically and has no replacement. - Obsolete `Scope.GetSpan()` removed, use `Span` property instead. - Obsolete `IUserFactory` removed, use `ISentryUserFactory` instead. -- `IHasMeasurements` has been removed, use `ISpanData` instead. -- `IHasBreadcrumbs` has been removed, use `IEventLike` instead. -- `ISpanContext` has been removed, use `ITraceContext` instead. -- `IHasTransactionNameSource` has been removed, use `ITransactionContext` instead. +- `IHasMeasurements` has been removed. Use `ISpanData` instead. +- `IHasBreadcrumbs` has been removed. Use `IEventLike` instead. +- `ISpanContext` has been removed. Use `ITraceContext` instead. +- `IHasTransactionNameSource` has been removed. Use `ITransactionContext` instead. - The unused `StackFrame.InstructionOffset` has been removed. - The unused `Scope.Platform` property has been removed. -- The obsolete setter `Sentry.PlatformAbstractions.Runtime.Identifier` has been removed -- `Sentry.Values` is now internal as it is never exposed in the public API -- The `TracePropagationTarget` class has been removed, use the `SubstringOrRegexPattern` class instead. +- The obsolete setter `Sentry.PlatformAbstractions.Runtime.Identifier` has been removed. +- `Sentry.Values` is now internal as it is never exposed in the public API. +- The `TracePropagationTarget` class has been removed. Use the `SubstringOrRegexPattern` class instead. - The `WithScope` and `WithScopeAsync` methods have been removed. We have discovered that these methods didn't work correctly in certain desktop contexts, especially when using a global scope.
Replace your usage of `WithScope` with overloads of `Capture*` methods: - `SentrySdk.CaptureEvent(SentryEvent @event, Action scopeCallback)` From 4b3c2e4962010bcb804de4f79002e18c7e191891 Mon Sep 17 00:00:00 2001 From: bitsandfoxes Date: Mon, 12 Feb 2024 18:30:30 +0100 Subject: [PATCH 4/8] updated mobile tfm explainer --- docs/platforms/dotnet/migration/index.mdx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/platforms/dotnet/migration/index.mdx b/docs/platforms/dotnet/migration/index.mdx index 25cca4ff2eb77..904a77a5e422e 100644 --- a/docs/platforms/dotnet/migration/index.mdx +++ b/docs/platforms/dotnet/migration/index.mdx @@ -13,10 +13,11 @@ Upgrading includes both breaking changes and new features. We're dropping support for some of the old target frameworks. See this [GitHub Discussion](https://github.com/getsentry/sentry-dotnet/discussions/2776) for details on why. - Support for .NET Framework 4.6.1 has been replaced with 4.6.2 because 4.6.1 went out of support in 2022. -- Support for .NET Core 3.1 and .NET 5 has been dropped -- Support for netstandard2.0 for Sentry.AspNetCore has been dropped -- Support for .NET 6 on mobile (e.g: `net6.0-android`) has been replaced with .NET 7 -
.NET 6 on mobile has been out of support since May 2023 and with .NET 8, it's no longer possible to build .NET 6 Mobile specific targets. For that reason, we're moving the mobile-specific TFMs from `net6.0-platform` to `net7.0-platform`. Mobile apps still work on .NET 6 will pull the `Sentry` .NET 6, which offers the .NET-only features, without native/platform-specific bindings and SDKs. See [this ticket for more details](https://github.com/getsentry/sentry-dotnet/issues/2623). +- Support for .NET Core 3.1 and .NET 5 has been dropped. +- Support for netstandard2.0 for Sentry.AspNetCore has been dropped. +- Support for .NET 6 on mobile (e.g: `net6.0-android`) has been replaced with .NET 7 . +
Due to changes in .NET 8, it's no longer possible to maintain support for .NET 6 mobile-specific targets. As a result, we are transitioning mobile-specific TFMs from `net6.0-platform` to `net7.0-platform`. This means that mobile apps built on .NET 6 will now utilize the `Sentry` .NET 6 package, which provides .NET-only features without native/platform-specific bindings and SDKs. For more information, please refer to [this ticket](https://github.com/getsentry/sentry-dotnet/issues/2623). + - Support for MAUI Tizen has been dropped ### Sentry Self-Hosted Compatibility From 5825c7bc41ffea360f06a5bdbb8ce01b7fb56117 Mon Sep 17 00:00:00 2001 From: Stefan Jandl Date: Mon, 12 Feb 2024 18:31:24 +0100 Subject: [PATCH 5/8] Update docs/platforms/dotnet/migration/index.mdx Co-authored-by: vivianyentran <20403606+vivianyentran@users.noreply.github.com> --- docs/platforms/dotnet/migration/index.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/platforms/dotnet/migration/index.mdx b/docs/platforms/dotnet/migration/index.mdx index 25cca4ff2eb77..b6888ebce03d9 100644 --- a/docs/platforms/dotnet/migration/index.mdx +++ b/docs/platforms/dotnet/migration/index.mdx @@ -29,7 +29,7 @@ This SDK version is compatible with a self-hosted version of Sentry `22.12.0` or - Transaction names for ASP.NET Core are now consistently named `HTTP-VERB /path` (e.g. `GET /home`). Previously, the leading forward slash was missing for some endpoints. - Setting `SentryOptions.Dsn` to `null` now throws `ArgumentNullException` during initialization. - `CaptureFailedRequests` is now enabled by default. -- Added `Sentry` namespace to global usings when `ImplicitUsings` is enabled +- When `ImplicitUsings` is enabled, the `Sentry` namespace is automatically added to global usings. If you have conflicts, you can opt out by adding the following to your `csproj`: ``` From 534f8ef4487b4c4802dbedfbae9c66352960a3ef Mon Sep 17 00:00:00 2001 From: bitsandfoxes Date: Mon, 12 Feb 2024 18:34:30 +0100 Subject: [PATCH 6/8] indent snippet --- docs/platforms/dotnet/migration/index.mdx | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/docs/platforms/dotnet/migration/index.mdx b/docs/platforms/dotnet/migration/index.mdx index 08ff310f47b4d..2fb8f008e4b06 100644 --- a/docs/platforms/dotnet/migration/index.mdx +++ b/docs/platforms/dotnet/migration/index.mdx @@ -30,13 +30,12 @@ This SDK version is compatible with a self-hosted version of Sentry `22.12.0` or - Transaction names for ASP.NET Core are now consistently named `HTTP-VERB /path` (e.g. `GET /home`). Previously, the leading forward slash was missing for some endpoints. - Setting `SentryOptions.Dsn` to `null` now throws `ArgumentNullException` during initialization. - `CaptureFailedRequests` is now enabled by default. -- When `ImplicitUsings` is enabled, the `Sentry` namespace is automatically added to global usings. -If you have conflicts, you can opt out by adding the following to your `csproj`: -``` - - false - -``` +- When `ImplicitUsings` is enabled, the `Sentry` namespace is automatically added to global usings. If you have conflicts, you can opt out by adding the following to your `csproj`: + ``` + + false + + ``` - Transactions' spans are no longer automatically finished with the status `deadline_exceeded` by the transaction. This is now handled by [Relay](https://github.com/getsentry/relay). - Customers self hosting Sentry must use version `22.12.0` or later - The `User.IpAddress` is now set to `{{auto}}` by default, even when `sendDefaultPII` is disabled. From dddb2c89c541272521db20ce05281df63ad76cea Mon Sep 17 00:00:00 2001 From: bitsandfoxes Date: Mon, 12 Feb 2024 18:44:45 +0100 Subject: [PATCH 7/8] TransactionContext snippet --- docs/platforms/dotnet/migration/index.mdx | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/docs/platforms/dotnet/migration/index.mdx b/docs/platforms/dotnet/migration/index.mdx index 2fb8f008e4b06..93bf9000d8af8 100644 --- a/docs/platforms/dotnet/migration/index.mdx +++ b/docs/platforms/dotnet/migration/index.mdx @@ -69,7 +69,21 @@ This SDK version is compatible with a self-hosted version of Sentry `22.12.0` or - `DebugImage` and `DebugMeta` moved to `Sentry.Protocol` namespace. - `SentryClient.Dispose` is no longer obsolete. - `ISentryClient.CaptureEvent` overloads have been replaced by a single method accepting optional `Hint` and `Scope` parameters. You will need to pass `hint` as a named parameter from code that calls `CaptureEvent` without passing a `scope` argument. -- `TransactionContext` and `SpanContext` constructors were updated. If you're constructing instances of these classes, you will need to adjust the order in which you pass parameters to these. +- `TransactionContext` and `SpanContext` constructors were updated and unified. If you're constructing instances of these classes, you will need to adjust the order in which you pass parameters to these. + ```csharp + public TransactionContext( + string name, + string operation, + SpanId? spanId = null, + SpanId? parentSpanId = null, + SentryId? traceId = null, + string? description = "", + SpanStatus? status = null, + bool? isSampled = null, + bool? isParentSampled = null, + TransactionNameSource nameSource = TransactionNameSource.Custom + ) + ``` - The `DiagnosticLogger` signature for `LogError` and `LogFatal` now takes the `exception` as the first parameter. This way, it no longer gets mixed up with the `TArgs`. The `DiagnosticLogger` now also receives an overload for `LogError` and `LogFatal` that accepts a message only. - `Distribution` added to `IEventLike`. - `StackFrame`'s `ImageAddress`, `InstructionAddress`, and `FunctionId` changed to `long?`. From 9e5ace288243464fe49594987bccbb46bf36ac3d Mon Sep 17 00:00:00 2001 From: bitsandfoxes Date: Mon, 12 Feb 2024 18:52:16 +0100 Subject: [PATCH 8/8] unified obsoletion/removal --- docs/platforms/dotnet/migration/index.mdx | 24 ++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/docs/platforms/dotnet/migration/index.mdx b/docs/platforms/dotnet/migration/index.mdx index 93bf9000d8af8..f9490656dc6b4 100644 --- a/docs/platforms/dotnet/migration/index.mdx +++ b/docs/platforms/dotnet/migration/index.mdx @@ -113,17 +113,19 @@ This SDK version is compatible with a self-hosted version of Sentry `22.12.0` or - `StitchAsyncCode` - no longer available. - `ProfilingTracesInterval` - no longer available. - `ProfilingEnabled` - use `ProfilesSampleRate` instead. -- Obsolete `SystemClock` constructor removed, use `SystemClock.Clock` instead. -- Obsolete `Runtime.Clone()` removed, this shouldn't have been public in the past and has no replacement. -- Obsolete `SentryException.Data` removed, use `SentryException.Mechanism.Data` instead. -- Obsolete `AssemblyExtensions` removed, this shouldn't have been public in the past and has no replacement. -- Obsolete `SentryDatabaseLogging.UseBreadcrumbs()` removed, it is called automatically and has no replacement. -- Obsolete `Scope.GetSpan()` removed, use `Span` property instead. -- Obsolete `IUserFactory` removed, use `ISentryUserFactory` instead. -- `IHasMeasurements` has been removed. Use `ISpanData` instead. -- `IHasBreadcrumbs` has been removed. Use `IEventLike` instead. -- `ISpanContext` has been removed. Use `ITraceContext` instead. -- `IHasTransactionNameSource` has been removed. Use `ITransactionContext` instead. +- A number of obsolete types have been removed: + - `SystemClock` - use `SystemClock.Clock` instead. + - `Scope.GetSpan()` - use `Span` property instead. + - `IUserFactory` - use `ISentryUserFactory` instead. + - `SentryException.Data` - use `SentryException.Mechanism.Data` instead. + - `Runtime.Clone()` - this shouldn't have been public in the past and has no replacement. + - `AssemblyExtensions` - this shouldn't have been public in the past and has no replacement. + - `SentryDatabaseLogging.UseBreadcrumbs()` - it is called automatically and has no replacement. +- A number of interfaces have removed: + - `IHasMeasurements` - use `ISpanData` instead. + - `IHasBreadcrumbs` - use `IEventLike` instead. + - `ISpanContext` - use `ITraceContext` instead. + - `IHasTransactionNameSource` - use `ITransactionContext` instead. - The unused `StackFrame.InstructionOffset` has been removed. - The unused `Scope.Platform` property has been removed. - The obsolete setter `Sentry.PlatformAbstractions.Runtime.Identifier` has been removed.