Skip to content

Commit 8ed9dbd

Browse files
authored
chore: Bump .NET SDK 4.1.2 (#1488)
1 parent 764a732 commit 8ed9dbd

File tree

27 files changed

+198
-57
lines changed

27 files changed

+198
-57
lines changed

CHANGELOG.md

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,112 @@
22

33
## Unreleased
44

5+
This major release is based on the .NET 4.0 release and includes features like [Metrics](https://docs.sentry.io/platforms/dotnet/metrics/)(preview) and [Spotlight](https://spotlightjs.com/).
6+
7+
### Significant change in behavior
8+
9+
- 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).
10+
- Customers self hosting Sentry must use verion 22.12.0 or later ([#3013](https://github.com/getsentry/sentry-dotnet/pull/3013))
11+
- The `User.IpAddress` is now set to `{{auto}}` by default, even when sendDefaultPII is disabled ([#2981](https://github.com/getsentry/sentry-dotnet/pull/2981))
12+
- The "Prevent Storing of IP Addresses" option in the "Security & Privacy" project settings on sentry.io can be used to control this instead
13+
- 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](https://github.com/getsentry/sentry-dotnet/pull/2987))
14+
15+
### API breaking Changes
16+
17+
If you have compilation errors you can find the affected types or overloads missing in the changelog entries below.
18+
19+
#### Changed APIs
20+
21+
- Class renamed from `Sentry.Attachment` to `Sentry.SentryAttachment` ([#3116](https://github.com/getsentry/sentry-dotnet/pull/3116))
22+
- Class renamed from `Sentry.Constants` to `Sentry.SentryConstants` ([#3125](https://github.com/getsentry/sentry-dotnet/pull/3125))
23+
- Class renamed from `Sentry.Context` to `Sentry.SentryContext` ([#3121](https://github.com/getsentry/sentry-dotnet/pull/3121))
24+
- Class renamed from `Sentry.Hint` to `Sentry.SentryHint` ([#3116](https://github.com/getsentry/sentry-dotnet/pull/3116))
25+
- Class renamed from `Sentry.Package` to `Sentry.SentryPackage` ([#3121](https://github.com/getsentry/sentry-dotnet/pull/3121))
26+
- Class renamed from `Sentry.Request` to `Sentry.SentryRequest` ([#3121](https://github.com/getsentry/sentry-dotnet/pull/3121))
27+
- Class renamed from `Sentry.Runtime` to `Sentry.SentryRuntime` ([#3016](https://github.com/getsentry/sentry-dotnet/pull/3016))
28+
- Class renamed from `Sentry.Session` to `Sentry.SentrySession` ([#3110](https://github.com/getsentry/sentry-dotnet/pull/3110))
29+
- Class renamed from `Sentry.Span` to `Sentry.SentrySpan` ([#3021](https://github.com/getsentry/sentry-dotnet/pull/3021))
30+
- Class renamed from `Sentry.Transaction` to `Sentry.SentryTransaction` ([#3023](https://github.com/getsentry/sentry-dotnet/pull/3023))
31+
- Class renamed from `Sentry.User` to `Sentry.SentryUser` ([#3015](https://github.com/getsentry/sentry-dotnet/pull/3015))
32+
- Interface renamed from `Sentry.IJsonSerializable` to `Sentry.ISentryJsonSerializable` ([#3116](https://github.com/getsentry/sentry-dotnet/pull/3116))
33+
- Interface renamed from `Sentry.ISession` to `Sentry.ISentrySession` ([#3110](https://github.com/getsentry/sentry-dotnet/pull/3110))
34+
- `SentryClient.Dispose` is no longer obsolete ([#2842](https://github.com/getsentry/sentry-dotnet/pull/2842))
35+
- `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](https://github.com/getsentry/sentry-dotnet/pull/2749))
36+
- `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](https://github.com/getsentry/sentry-dotnet/pull/2731), [#2870](https://github.com/getsentry/sentry-dotnet/pull/2870))
37+
- `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](https://github.com/getsentry/sentry-dotnet/pull/2694), [#2696](https://github.com/getsentry/sentry-dotnet/pull/2696))
38+
- 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](https://github.com/getsentry/sentry-dotnet/pull/2715))
39+
- `Distribution` added to `IEventLike`. ([#2660](https://github.com/getsentry/sentry-dotnet/pull/2660))
40+
- `StackFrame`'s `ImageAddress`, `InstructionAddress`, and `FunctionId` changed to `long?`. ([#2691](https://github.com/getsentry/sentry-dotnet/pull/2691))
41+
- `DebugImage` and `DebugMeta` moved to `Sentry.Protocol` namespace. ([#2815](https://github.com/getsentry/sentry-dotnet/pull/2815))
42+
- `DebugImage.ImageAddress` changed to `long?`. ([#2725](https://github.com/getsentry/sentry-dotnet/pull/2725))
43+
- Contexts now inherit from `IDictionary` rather than `ConcurrentDictionary`. The specific dictionary being used is an implementation detail. ([#2729](https://github.com/getsentry/sentry-dotnet/pull/2729))
44+
45+
#### Removed APIs
46+
47+
- SentrySinkExtensions.ConfigureSentrySerilogOptions is now internal. If you were using this method, please use one of the `SentrySinkExtensions.Sentry` extension methods instead. ([#2902](https://github.com/getsentry/sentry-dotnet/pull/2902))
48+
- A number of `[Obsolete]` options have been removed ([#2841](https://github.com/getsentry/sentry-dotnet/pull/2841))
49+
- `BeforeSend` - use `SetBeforeSend` instead.
50+
- `BeforeSendTransaction` - use `SetBeforeSendTransaction` instead.
51+
- `BeforeBreadcrumb` - use `SetBeforeBreadcrumb` instead.
52+
- `CreateHttpClientHandler` - use `CreateHttpMessageHandler` instead.
53+
- `DisableTaskUnobservedTaskExceptionCapture` method has been renamed to `DisableUnobservedTaskExceptionCapture`.
54+
- `DebugDiagnosticLogger` - use `TraceDiagnosticLogger` instead.
55+
- `KeepAggregateException` - this property is no longer used and has no replacement.
56+
- `ReportAssemblies` - use `ReportAssembliesMode` instead.
57+
- Obsolete `SystemClock` constructor removed, use `SystemClock.Clock` instead. ([#2856](https://github.com/getsentry/sentry-dotnet/pull/2856))
58+
- Obsolete `Runtime.Clone()` removed, this shouldn't have been public in the past and has no replacement. ([#2856](https://github.com/getsentry/sentry-dotnet/pull/2856))
59+
- Obsolete `SentryException.Data` removed, use `SentryException.Mechanism.Data` instead. ([#2856](https://github.com/getsentry/sentry-dotnet/pull/2856))
60+
- Obsolete `AssemblyExtensions` removed, this shouldn't have been public in the past and has no replacement. ([#2856](https://github.com/getsentry/sentry-dotnet/pull/2856))
61+
- Obsolete `SentryDatabaseLogging.UseBreadcrumbs()` removed, it is called automatically and has no replacement. ([#2856](https://github.com/getsentry/sentry-dotnet/pull/2856))
62+
- Obsolete `Scope.GetSpan()` removed, use `Span` property instead. ([#2856](https://github.com/getsentry/sentry-dotnet/pull/2856))
63+
- Obsolete `IUserFactory` removed, use `ISentryUserFactory` instead. ([#2856](https://github.com/getsentry/sentry-dotnet/pull/2856), [#2840](https://github.com/getsentry/sentry-dotnet/pull/2840))
64+
- `IHasMeasurements` has been removed, use `ISpanData` instead. ([#2659](https://github.com/getsentry/sentry-dotnet/pull/2659))
65+
- `IHasBreadcrumbs` has been removed, use `IEventLike` instead. ([#2670](https://github.com/getsentry/sentry-dotnet/pull/2670))
66+
- `ISpanContext` has been removed, use `ITraceContext` instead. ([#2668](https://github.com/getsentry/sentry-dotnet/pull/2668))
67+
- `IHasTransactionNameSource` has been removed, use `ITransactionContext` instead. ([#2654](https://github.com/getsentry/sentry-dotnet/pull/2654))
68+
- ([#2694](https://github.com/getsentry/sentry-dotnet/pull/2694))
69+
- The unused `StackFrame.InstructionOffset` has been removed. ([#2691](https://github.com/getsentry/sentry-dotnet/pull/2691))
70+
- The unused `Scope.Platform` property has been removed. ([#2695](https://github.com/getsentry/sentry-dotnet/pull/2695))
71+
- The obsolete setter `Sentry.PlatformAbstractions.Runtime.Identifier` has been removed ([2764](https://github.com/getsentry/sentry-dotnet/pull/2764))
72+
- `Sentry.Values<T>` is now internal as it is never exposed in the public API ([#2771](https://github.com/getsentry/sentry-dotnet/pull/2771))
73+
- The `TracePropagationTarget` class has been removed, use the `SubstringOrRegexPattern` class instead. ([#2763](https://github.com/getsentry/sentry-dotnet/pull/2763))
74+
- 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](https://github.com/getsentry/sentry-dotnet/pull/2717))
75+
Replace your usage of `WithScope` with overloads of `Capture*` methods:
76+
77+
- `SentrySdk.CaptureEvent(SentryEvent @event, Action<Scope> scopeCallback)`
78+
- `SentrySdk.CaptureMessage(string message, Action<Scope> scopeCallback)`
79+
- `SentrySdk.CaptureException(Exception exception, Action<Scope> scopeCallback)`
80+
81+
```c#
82+
// Before
83+
SentrySdk.WithScope(scope =>
84+
{
85+
scope.SetTag("key", "value");
86+
SentrySdk.CaptureEvent(new SentryEvent());
87+
});
88+
89+
// After
90+
SentrySdk.CaptureEvent(new SentryEvent(), scope =>
91+
{
92+
// Configure your scope here
93+
scope.SetTag("key", "value");
94+
});
95+
```
96+
97+
### Features
98+
99+
- 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](https://github.com/getsentry/sentry-dotnet/pull/2949))
100+
- `SentrySdk.Metrics.Set` now additionally accepts `string` as value ([#3092](https://github.com/getsentry/sentry-dotnet/pull/3092))
101+
- Timing metrics can now be captured with `SentrySdk.Metrics.StartTimer` ([#3075](https://github.com/getsentry/sentry-dotnet/pull/3075))
102+
- Support for [Spotlight](https://spotlightjs.com/), a debug tool for local development. ([#2961](https://github.com/getsentry/sentry-dotnet/pull/2961))
103+
- Enable it with the option `EnableSpotlight`
104+
- Optionally configure the URL to connect via `SpotlightUrl`. Defaults to `http://localhost:8969/stream`.
105+
5106
### Dependencies
6107

108+
- Bump .NET SDK from v3.41.3 to v4.0.0 [#1505](https://github.com/getsentry/sentry-unity/pull/1488)
109+
- [changelog](https://github.com/getsentry/sentry-dotnet/blob/main/CHANGELOG.md#400)
110+
- [diff](https://github.com/getsentry/sentry-dotnet/compare/3.41.3...4.0.0)
7111
- Bump CLI from v2.24.1 to v2.28.6 ([#1534](https://github.com/getsentry/sentry-unity/pull/1534), [#1539](https://github.com/getsentry/sentry-unity/pull/1539), [#1540](https://github.com/getsentry/sentry-unity/pull/1540), [#1542](https://github.com/getsentry/sentry-unity/pull/1542), [#1547](https://github.com/getsentry/sentry-unity/pull/1547), [#1560](https://github.com/getsentry/sentry-unity/pull/1560), [#1562](https://github.com/getsentry/sentry-unity/pull/1562))
8112
- [changelog](https://github.com/getsentry/sentry-cli/blob/master/CHANGELOG.md#2286)
9113
- [diff](https://github.com/getsentry/sentry-cli/compare/2.24.1...2.28.6)

samples/unity-of-bugs/Assets/Scripts/AdditionalButtons.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public void SetUser()
1010
{
1111
SentrySdk.ConfigureScope(s =>
1212
{
13-
s.User = new User
13+
s.User = new SentryUser
1414
{
1515
Email = "[email protected]",
1616
Username = "ant",

src/Sentry.Unity.Android/AndroidJavaScopeObserver.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public override void UnsetTagImpl(string key)
4545
sentry.CallStatic("removeTag", key);
4646
}
4747

48-
public override void SetUserImpl(User user)
48+
public override void SetUserImpl(SentryUser user)
4949
{
5050
AndroidJNI.AttachCurrentThread();
5151

src/Sentry.Unity.Android/SentryNativeAndroid.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public static void Configure(SentryUnityOptions options, ISentryUnityInfo sentry
5151
catch (Exception e)
5252
{
5353
options.DiagnosticLogger?.LogError(
54-
"Failed to reinstall backend. Captured native crashes will miss scope data and tag.", e);
54+
e, "Failed to reinstall backend. Captured native crashes will miss scope data and tag.");
5555
}
5656

5757
options.NativeSupportCloseCallback = () => Close(options.DiagnosticLogger);

src/Sentry.Unity.Editor.iOS/BuildPostProcess.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ internal static void SetupNoOpBridge(IDiagnosticLogger logger, string pathToProj
9292
}
9393
catch (Exception e)
9494
{
95-
logger.LogError("Failed to add the Sentry NoOp bridge to the output project.", e);
95+
logger.LogError(e, "Failed to add the Sentry NoOp bridge to the output project.");
9696
}
9797
}
9898

@@ -133,7 +133,7 @@ internal static void SetupSentry(SentryUnityOptions options,
133133
}
134134
catch (Exception e)
135135
{
136-
logger.LogError("Failed to add the Sentry framework to the generated Xcode project", e);
136+
logger.LogError(e, "Failed to add the Sentry framework to the generated Xcode project");
137137
return;
138138
}
139139

src/Sentry.Unity.Editor/Android/AndroidManifestConfiguration.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ internal void AddAndroidSdkDependencies(string gradleProjectPath)
224224
}
225225
catch (Exception e)
226226
{
227-
_logger.LogError($"Failed to {(nativeSupportEnabled ? "add" : "remove")} Android Dependencies in the gradle project", e);
227+
_logger.LogError(e, $"Failed to {(nativeSupportEnabled ? "add" : "remove")} Android Dependencies in the gradle project");
228228
}
229229
}
230230

@@ -277,7 +277,7 @@ internal void SetupSymbolsUpload(string unityProjectPath, string gradleProjectPa
277277
}
278278
catch (Exception e)
279279
{
280-
_logger.LogError("Failed to add the automatic symbols upload to the gradle project", e);
280+
_logger.LogError(e, "Failed to add the automatic symbols upload to the gradle project");
281281
}
282282
}
283283

@@ -299,7 +299,7 @@ private void SetupProguard(string gradleProjectPath)
299299
}
300300
catch (Exception e)
301301
{
302-
_logger.LogError($"Failed to {(nativeSupportEnabled ? "add" : "remove")} Proguard rules in the gradle project", e);
302+
_logger.LogError(e, $"Failed to {(nativeSupportEnabled ? "add" : "remove")} Proguard rules in the gradle project");
303303
}
304304
}
305305

src/Sentry.Unity.Editor/AutoInstrumentation/SentryPerformanceAutoInstrumentation.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ public void OnPostBuildPlayerScriptDLLs(BuildReport report)
4747
}
4848
catch (Exception e)
4949
{
50-
logger.LogError("Failed to add the performance auto instrumentation. " +
51-
"The assembly has not been modified.", e);
50+
logger.LogError(e, "Failed to add the performance auto instrumentation. " +
51+
"The assembly has not been modified.");
5252
}
5353

5454
stopwatch.Stop();

src/Sentry.Unity.Editor/Native/BuildPostProcess.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public static void OnPostProcessBuild(BuildTarget target, string executablePath)
5757
}
5858
catch (Exception e)
5959
{
60-
logger.LogError("Failed to add the Sentry native integration to the built application", e);
60+
logger.LogError(e, "Failed to add the Sentry native integration to the built application");
6161
throw new BuildFailedException("Sentry Native BuildPostProcess failed");
6262
}
6363
}

src/Sentry.Unity.Native/NativeScopeObserver.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public override void SetExtraImpl(string key, string? value) =>
3030

3131
public override void UnsetTagImpl(string key) => C.sentry_remove_tag(key);
3232

33-
public override void SetUserImpl(User user)
33+
public override void SetUserImpl(SentryUser user)
3434
{
3535
// see https://develop.sentry.dev/sdk/event-payloads/user/
3636
var cUser = C.sentry_value_new_object();

src/Sentry.Unity.Native/SentryNative.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public static void Configure(SentryUnityOptions options, ISentryUnityInfo sentry
4646
options.DefaultUserId = AnalyticsSessionInfo.userId;
4747
if (options.DefaultUserId is not null)
4848
{
49-
options.ScopeObserver.SetUser(new User { Id = options.DefaultUserId });
49+
options.ScopeObserver.SetUser(new SentryUser { Id = options.DefaultUserId });
5050
}
5151

5252
// Note: we must actually call the function now and on every other call use the value we get here.

0 commit comments

Comments
 (0)