Skip to content
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

Update sentry-dotnet monorepo to v4 (major) #118

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Feb 1, 2024

Mend Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
Sentry (source) 3.41.4 -> 4.6.2 age adoption passing confidence
Sentry.Serilog (source) 3.41.4 -> 4.6.2 age adoption passing confidence

Release Notes

getsentry/sentry-dotnet (Sentry)

v4.6.2

Compare Source

Fixes
  • Reverted changes to the SentryHttpMessageHandler and SentryGraphQLHttpMessageHandler to automatically create transactions for each request as this could negatively affect users' quota (#​3367)

v4.6.1

Compare Source

Fixes
  • Fixed SentryHttpMessageHandler and SentryGraphQLHttpMessageHandler not creating spans when there is no active Transaction on the scope (#​3360)
  • The SDK no longer (wrongly) initializes sentry-native on Blazor WASM builds with RunAOTCompilation enabled. (#​3363)
  • HttpClient requests now show on the Requests dashboard in Sentry (#​3357)
Dependencies
  • Bump Hangfire from v1.8.7 to v1.8.12 (#​3361)

v4.6.0

Compare Source

Features
  • Hints now accept byte[] as attachment (#​3352)
  • InApp includes/excludes can now be configured using regular expressions (#​3321)
Fixes
  • Fixed memory leak in BackgroundWorker observed when using Sentry with Quartz and MySql (#​3355)
Dependencies

v4.5.0

Compare Source

Features
  • Extended the SDK's CheckIn support by adding Release, Environment and Trace ID to the event. CheckIns created via the Hangfire integration now also automatically report their duration (#​3320)
  • The SDK's performance API now works in conjunction with OpenTelemetry's instrumentation. This means that SentrySpans and OTel spans now show up in the same span-tree. (#​3288)
Fixes
  • HttpResponse.Content is no longer disposed by when using SentryHttpFailedRequestHandler on .NET Framework, which was causing an ObjectDisposedException when using Sentry with NSwag (#​3306)
  • Fix BackgroundWorker exiting when OperationCanceledException is not from shutdown request (3284)
  • Envelopes with large attachments no longer get stuck in the queue when using CacheDirectoryPath (#​3328)
Dependencies

v4.4.0

Compare Source

Features
  • Metrics now honor any Rate Limits set in HTTP headers returned by Sentry (#​3276)
Fixes
  • Fixed normalization for metric tag values for carriage return, line feed and tab characters (#​3281)
Dependencies

v4.3.0

Compare Source

Features
  • EnableNetworkEventBreadcrumbs can now be set on the Native Android options (#​3267)
  • Update normalization of metrics keys, tags and values (#​3271)
Fixes
  • Fix missing exception StackTraces in some situations (#​3215)
  • Scopes now get applied to OTEL spans in ASP.NET Core (#​3221)
  • Fixed InvalidCastException when setting the SampleRate on Android (#​3258)
  • Fixed MAUI iOS build issue related to SentryVersionNumber and SentryVersionString (#​3278)
API changes
  • Removed SentryOptionsExtensions class - all the public methods moved directly to SentryOptions (#​3195)
Dependencies

v4.2.1

Compare Source

Fixes
  • Dynamic Sampling Context not propagated correctly for HttpClient spans (#​3208)

v4.2.0

Compare Source

Features
  • ASP.NET Core: Blocking call detection. An event with the stack trace of the blocking call will be captured as event. (#​2709)
    • IMPORTANT: Verify this in test/staging before prod! Blocking calls in hot paths could create a lot of events for your Sentry project.
    • Opt-in via options.CaptureBlockingCalls = true
    • Disabled for specific code blocks with using (new SuppressBlockingDetection())
    • Doesn't detect everything. See original Caveats described by Ben Adams.
  • Added Crons support via SentrySdk.CaptureCheckIn and an integration with Hangfire (#​3128)
  • Common tags set automatically for metrics and metrics summaries are attached to Spans (#​3191)
API changes
  • Removed ScopeExtensions class - all the public methods moved directly to Scope (#​3186)
Fixes
  • The Sentry Middleware on ASP.NET Core no longer throws an exception after having been initialized multiple times (#​3185)
  • Empty strings are used instead of underscores to replace invalid metric tag values (#​3176)
  • Filtered OpenTelemetry spans are garbage collected correctly (#​3198)
Dependencies

v4.1.2

Compare Source

Fixes
  • Metric unit names are now sanitized correctly. This was preventing some built in metrics from showing in the Sentry dashboard (#​3151)
  • The Sentry OpenTelemetry integration no longer throws an exception with the SDK disabled (#​3156)

v4.1.1

Compare Source

Fixes
  • The SDK can be disabled by setting options.Dsn = ""; By convention, the SDK allows the DSN set to string.Empty to be overwritten by the environment. (#​3147)
Dependencies

v4.1.0

Compare Source

Features
  • The SDK now automatically collects metrics coming from OpenTelemetry.Instrumentation.Runtime (#​3133)
Fixes
  • "No service for type 'Sentry.IHub' has been registered" exception when using OpenTelemetry and initializing Sentry via SentrySdk.Init (#​3129)

v4.0.3

Compare Source

Fixes
  • To resolve conflicting types due to the SDK adding itself to the global usings:
    • The class Sentry.Constants has been renamed to Sentry.SentryConstants (#​3125)

v4.0.2

Compare Source

Fixes
  • To resolve conflicting types due to the SDK adding itself to the global usings:
    • The class Sentry.Context has been renamed to Sentry.SentryContext (#​3121)
    • The class Sentry.Package has been renamed to Sentry.SentryPackage (#​3121)
    • The class Sentry.Request has been renamed to Sentry.SentryRequest (#​3121)
Dependencies

v4.0.1

Compare Source

Fixes
  • To resolve conflicting types due to the SDK adding itself to the global usings:
    • The interface Sentry.ISession has been renamed to Sentry.ISentrySession (#​3110)
    • The interface Sentry.IJsonSerializable has been renamed to Sentry.ISentryJsonSerializable (#​3116)
    • The class Sentry.Session has been renamed to Sentry.SentrySession (#​3110)
    • The class Sentry.Attachment has been renamed to Sentry.SentryAttachment (#​3116)
    • The class Sentry.Hint has been renamed to Sentry.SentryHint (#​3116)
Dependencies

v4.0.0

Compare Source

This major release includes many exciting new features including support for Profiling and Metrics(preview), AOT with Native Crash Reporting, Spotlight, Screenshots on MAUI and much more. Details about these features and other changes are below.

.NET target framework changes

We're dropping support for some of the old target frameworks, please check this GitHub Discussion for details on why.

  • Replace support for .NET Framework 4.6.1 with 4.6.2 (#​2786)

    .NET Framework 4.6.1 was announced on Nov 30, 2015. And went out of support over a year ago, on Apr 26, 2022.

  • Drop .NET Core 3.1 and .NET 5 support (#​2787)

  • Dropped netstandard2.0 support for Sentry.AspNetCore (#​2807)

  • Replace support for .NET 6 on mobile (e.g: net6.0-android) with .NET 7 (#​2624)

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

  • MAUI dropped Tizen support (#​2734)

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 (aka on-premise), you will need to upgrade.

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. (#​2808)
  • Setting SentryOptions.Dsn to null now throws ArgumentNullException during initialization. (#​2655)
  • Enable CaptureFailedRequests by default (#​2688)
  • Added Sentry namespace to global usings when ImplicitUsings is enabled (#​3043)
    If you have conflicts, you can opt out by adding the following to your csproj:
<PropertyGroup>
  <SentryImplicitUsings>false</SentryImplicitUsings>
</PropertyGroup>
  • Transactions' spans are no longer automatically finished with the status deadline_exceeded by the transaction. This is now handled by the Relay.
    • Customers self hosting Sentry must use verion 22.12.0 or later (#​3013)
  • The User.IpAddress is now set to {{auto}} by default, even when sendDefaultPII is disabled (#​2981)
    • 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. (#​2987)
API breaking Changes

If you have compilation errors you can find the affected types or overloads missing in the changelog entries below.

Changed APIs
  • Class renamed Sentry.User to Sentry.SentryUser (#​3015)
  • Class renamed Sentry.Runtime to Sentry.SentryRuntime (#​3016)
  • Class renamed Sentry.Span to Sentry.SentrySpan (#​3021)
  • Class renamed Sentry.Transaction to Sentry.SentryTransaction (#​3023)
  • Rename iOS and MacCatalyst platform-specific options from Cocoa to Native (#​2940)
  • Rename iOS platform-specific options EnableCocoaSdkTracing to EnableTracing (#​2940)
  • Rename Android platform-specific options from Android to Native (#​2940)
  • Rename Android platform-specific options EnableAndroidSdkTracing and EnableAndroidSdkBeforeSend to EnableTracing and EnableBeforeSend respectively (#​2940)
  • Rename iOS and MacCatalyst platform-specific options from iOS to Cocoa (#​2929)
  • ITransaction has been renamed to ITransactionTracer. You will need to update any references to these interfaces in your code to use the new interface names (#​2731, #​2870)
  • DebugImage and DebugMeta moved to Sentry.Protocol namespace. (#​2815)
  • SentryClient.Dispose is no longer obsolete (#​2842)
  • 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. (#​2749)
  • 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. (#​2694, #​2696)
  • 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. (#​2715)
  • Distribution added to IEventLike. (#​2660)
  • StackFrame's ImageAddress, InstructionAddress, and FunctionId changed to long?. (#​2691)
  • DebugImage.ImageAddress changed to long?. (#​2725)
  • Contexts now inherit from IDictionary rather than ConcurrentDictionary. The specific dictionary being used is an implementation detail. (#​2729)
  • 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")). (#​2928)
Removed APIs
  • SentrySinkExtensions.ConfigureSentrySerilogOptions is now internal. If you were using this method, please use one of the SentrySinkExtensions.Sentry extension methods instead. (#​2902)

  • A number of [Obsolete] options have been removed (#​2841)

    • 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 (#​2856)

    • 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. (#​2856)

  • Obsolete Runtime.Clone() removed, this shouldn't have been public in the past and has no replacement. (#​2856)

  • Obsolete SentryException.Data removed, use SentryException.Mechanism.Data instead. (#​2856)

  • Obsolete AssemblyExtensions removed, this shouldn't have been public in the past and has no replacement. (#​2856)

  • Obsolete SentryDatabaseLogging.UseBreadcrumbs() removed, it is called automatically and has no replacement. (#​2856)

  • Obsolete Scope.GetSpan() removed, use Span property instead. (#​2856)

  • Obsolete IUserFactory removed, use ISentryUserFactory instead. (#​2856, #​2840)

  • IHasMeasurements has been removed, use ISpanData instead. (#​2659)

  • IHasBreadcrumbs has been removed, use IEventLike instead. (#​2670)

  • ISpanContext has been removed, use ITraceContext instead. (#​2668)

  • IHasTransactionNameSource has been removed, use ITransactionContext instead. (#​2654)

  • (#​2694)

  • The unused StackFrame.InstructionOffset has been removed. (#​2691)

  • The unused Scope.Platform property has been removed. (#​2695)

  • The obsolete setter Sentry.PlatformAbstractions.Runtime.Identifier has been removed (2764)

  • Sentry.Values<T> is now internal as it is never exposed in the public API (#​2771)

  • The TracePropagationTarget class has been removed, use the SubstringOrRegexPattern class instead. (#​2763)

  • 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. (#​2717)

    Replace your usage of WithScope with overloads of Capture* methods:

    • SentrySdk.CaptureEvent(SentryEvent @&#8203;event, Action<Scope> scopeCallback)
    • SentrySdk.CaptureMessage(string message, Action<Scope> scopeCallback)
    • SentrySdk.CaptureException(Exception exception, Action<Scope> scopeCallback)
    // 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");
    });
Features
  • Experimental pre-release availability of Metrics. We're exploring the use of Metrics in Sentry. The API will very likely change and we don't yet have any documentation. (#​2949)
    • SentrySdk.Metrics.Set now additionally accepts string as value (#​3092)
    • Timing metrics can now be captured with SentrySdk.Metrics.StartTimer (#​3075)
    • Added support for capturing built-in metrics from the System.Diagnostics.Metrics API (#​3052)
  • Sentry.Profiling is now available as a package on nuget. Be aware that profiling is in alpha and on servers the overhead could be high. Improving the experience for ASP.NET Core is tracked on this issue (#​2800)
    • iOS profiling support (alpha). (#​2930)
  • Native crash reporting on NativeAOT published apps (Windows, Linux, macOS). (#​2887)
  • Support for Spotlight, a debug tool for local development. (#​2961)
    • Enable it with the option EnableSpotlight
    • Optionally configure the URL to connect via SpotlightUrl. Defaults to http://localhost:8969/stream.
MAUI
  • Added screenshot capture support for errors. You can opt-in via SentryMauiOptions.AttachScreenshots (#​2965)
    • Supports Android and iOS only. Windows is not supported.
  • App context now has in_foreground, indicating whether the app was in the foreground or the background. (#​2983)
  • Android: When capturing unhandled exceptions, the SDK now can automatically attach LogCat to the event. You can opt-in via SentryOptions.Android.LogCatIntegration and configure SentryOptions.Android.LogCatMaxLines. (#​2926)
    • Available when targeting net7.0-android or later, on API level 23 or later.
Native AOT

Native AOT publishing support for .NET 8 has been added to Sentry for the following platforms:

  • Windows
  • Linux
  • macOS
  • Mac Catalyst
  • iOS

There are some functional differences when publishing Native AOT:

  • StackTraceMode.Enhanced is ignored because it's not available when publishing Native AOT. The mechanism to generate these enhanced stack traces relies heavily on reflection which isn't compatible with trimming.
  • Reflection cannot be leveraged for JSON Serialization and you may need to use SentryOptions.AddJsonSerializerContext to supply a serialization context for types that you'd like to send to Sentry (e.g. in the Span.Context). (#​2732, #​2793)
  • Ben.Demystifier is not available as it only runs in JIT mode.
  • WinUI applications: When publishing Native AOT, Sentry isn't able to automatically register an unhandled exception handler because that relies on reflection. You'll need to register the unhandled event handler manually instead.
  • For Azure Functions Workers, when AOT/Trimming is enabled we can't use reflection to read route data from the HttpTrigger so the route name will always be /api/<FUNCTION_NAME> (#​2920)
Fixes
  • Native integration logging on macOS (#​3079)
  • The scope transaction is now correctly set for Otel transactions (#​3072)
  • Fixed an issue with tag values in metrics not being properly serialized (#​3065)
  • Moved the binding to MAUI events for breadcrumb creation from WillFinishLaunching to FinishedLaunching. This delays the initial instantiation of app. (#​3057)
  • The SDK no longer adds the WinUIUnhandledExceptionIntegration on non-Windows platforms (#​3055)
  • Stop Sentry for MacCatalyst from creating default.profraw in the app bundle using xcodebuild archive to build sentry-cocoa (#​2960)
  • Workaround a .NET 8 NativeAOT crash on transaction finish. (#​2943)
  • Reworked automatic breadcrumb creation for MAUI. (#​2900)
    • The SDK no longer uses reflection to bind to all public element events. This also fixes issues where the SDK would consume third-party events.
    • Added CreateElementEventsBreadcrumbs to the SentryMauiOptions to allow users to opt-in automatic breadcrumb creation for BindingContextChanged, ChildAdded, ChildRemoved, and ParentChanged on Element.
    • Reduced amount of automatic breadcrumbs by limiting the number of bindings created in VisualElement, Window, Shell, Page, and Button.
  • Fixed Sentry SDK has not been initialized when using ASP.NET Core, Serilog, and OpenTelemetry (#​2911)
  • Android native symbol upload (#​2876)
  • Sentry.Serilog no longer throws if a disabled DSN is provided when initializing Sentry via the Serilog integration (#​2883)
  • Don't add WinUI exception integration on mobile platforms (#​2821)
  • Transactions are now getting enriched by the client instead of the hub (#​2838)
  • Fixed an issue when using the SDK together with OpenTelemetry 1.5.0 and newer where the SDK would create transactions for itself. The fix is backward compatible. (#​3001)
Dependencies

Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about these updates again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Mend Renovate. View repository job log here.

@renovate renovate bot force-pushed the renovate/major-sentry-dotnet-monorepo branch 4 times, most recently from 4f9baa5 to c679c2b Compare February 7, 2024 18:57
@renovate renovate bot force-pushed the renovate/major-sentry-dotnet-monorepo branch 2 times, most recently from 13d2e93 to 9fee28b Compare February 14, 2024 21:34
@renovate renovate bot force-pushed the renovate/major-sentry-dotnet-monorepo branch 2 times, most recently from f3ce0fb to aa12d1f Compare February 25, 2024 17:29
@renovate renovate bot force-pushed the renovate/major-sentry-dotnet-monorepo branch 2 times, most recently from 5b1040e to 6184965 Compare March 12, 2024 14:04
@renovate renovate bot force-pushed the renovate/major-sentry-dotnet-monorepo branch from 6184965 to 3518478 Compare March 18, 2024 20:39
@renovate renovate bot force-pushed the renovate/major-sentry-dotnet-monorepo branch 2 times, most recently from 6ff0e65 to d496e47 Compare April 13, 2024 01:15
@renovate renovate bot force-pushed the renovate/major-sentry-dotnet-monorepo branch from d496e47 to ffe762e Compare April 30, 2024 23:08
@renovate renovate bot force-pushed the renovate/major-sentry-dotnet-monorepo branch 2 times, most recently from 49d4c78 to c09d360 Compare May 14, 2024 10:47
@renovate renovate bot force-pushed the renovate/major-sentry-dotnet-monorepo branch from c09d360 to 40b0ae5 Compare May 14, 2024 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

0 participants