Skip to content

Commit a8aa81e

Browse files
authored
Merge branch 'version-5.0.0' into trace-context-origin
2 parents f6a93bf + 225fd1e commit a8aa81e

14 files changed

+4
-119
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
## Version Five
44

55
### API Changes
6+
7+
- You should no longer pass `AndroidContext` as an argument to `SentrySdk.Init` ([#3562](https://github.com/getsentry/sentry-dotnet/pull/3562))
8+
- The `SentryUser.Segment` property has been deprecated. Consider sending this as a tag or additional data instead ([#3563](https://github.com/getsentry/sentry-dotnet/pull/3563))
69
- The ITraceContext now includes an [Origin](https://develop.sentry.dev/sdk/telemetry/traces/trace-origin/), which is set automatically and is primarily used internally by the Sentry server ([#3564](https://github.com/getsentry/sentry-dotnet/pull/3564))
710

811
## 4.10.2

src/Sentry.NLog/SentryTarget.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -453,9 +453,6 @@ private void InnerWrite(LogEventInfo logEvent)
453453
Username = User.Username?.Render(logEvent),
454454
Email = User.Email?.Render(logEvent),
455455
IpAddress = User.IpAddress?.Render(logEvent),
456-
#pragma warning disable CS0618 // Type or member is obsolete
457-
Segment = User.Segment?.Render(logEvent)
458-
#pragma warning restore CS0618 // Type or member is obsolete
459456
};
460457

461458
if (User.Other?.Count > 0)

src/Sentry/DynamicSamplingContext.cs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ private DynamicSamplingContext(
2626
double? sampleRate = null,
2727
string? release = null,
2828
string? environment = null,
29-
string? userSegment = null,
3029
string? transactionName = null)
3130
{
3231
// Validate and set required values
@@ -72,11 +71,6 @@ private DynamicSamplingContext(
7271
items.Add("environment", environment);
7372
}
7473

75-
if (!string.IsNullOrWhiteSpace(userSegment))
76-
{
77-
items.Add("user_segment", userSegment);
78-
}
79-
8074
if (!string.IsNullOrWhiteSpace(transactionName))
8175
{
8276
items.Add("transaction", transactionName);
@@ -127,9 +121,6 @@ public static DynamicSamplingContext CreateFromTransaction(TransactionTracer tra
127121
var traceId = transaction.TraceId;
128122
var sampled = transaction.IsSampled;
129123
var sampleRate = transaction.SampleRate!.Value;
130-
#pragma warning disable CS0618 // Type or member is obsolete
131-
var userSegment = transaction.User.Segment;
132-
#pragma warning restore CS0618 // Type or member is obsolete
133124
var transactionName = transaction.NameSource.IsHighQuality() ? transaction.Name : null;
134125

135126
// These two may not have been set yet on the transaction, but we can get them directly.
@@ -143,7 +134,6 @@ public static DynamicSamplingContext CreateFromTransaction(TransactionTracer tra
143134
sampleRate,
144135
release,
145136
environment,
146-
userSegment,
147137
transactionName);
148138
}
149139

src/Sentry/Platforms/Android/Extensions/UserExtensions.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@ public static SentryUser ToUser(this JavaSdk.Protocol.User user) =>
1212
Id = user.Id,
1313
IpAddress = user.IpAddress,
1414
Username = user.Username,
15-
#pragma warning disable CS0618 // Type or member is obsolete
16-
Segment = user.Segment,
17-
#pragma warning restore CS0618 // Type or member is obsolete
1815
Other = user.Data ?? EmptyDictionary
1916
};
2017

@@ -25,9 +22,6 @@ public static JavaSdk.Protocol.User ToJavaUser(this SentryUser user) =>
2522
Id = user.Id,
2623
IpAddress = user.IpAddress,
2724
Username = user.Username,
28-
#pragma warning disable CS0618 // Type or member is obsolete
29-
Segment = user.Segment,
30-
#pragma warning restore CS0618 // Type or member is obsolete
3125
Data = user.Other.Count == 0 ? null : user.Other
3226
};
3327
}

src/Sentry/Platforms/Android/SentrySdk.cs

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -20,34 +20,6 @@ public static partial class SentrySdk
2020
{
2121
private static AndroidContext AppContext { get; set; } = Application.Context;
2222

23-
/// <summary>
24-
/// Initializes the SDK for Android, with an optional configuration options callback.
25-
/// </summary>
26-
/// <param name="context">The Android application context.</param>
27-
/// <param name="configureOptions">The configuration options callback.</param>
28-
/// <returns>An object that should be disposed when the application terminates.</returns>
29-
[Obsolete("It is no longer required to provide the application context when calling Init. " +
30-
"This method may be removed in a future major release.")]
31-
public static IDisposable Init(AndroidContext context, Action<SentryOptions>? configureOptions)
32-
{
33-
AppContext = context;
34-
return Init(configureOptions);
35-
}
36-
37-
/// <summary>
38-
/// Initializes the SDK for Android, using a configuration options instance.
39-
/// </summary>
40-
/// <param name="context">The Android application context.</param>
41-
/// <param name="options">The configuration options instance.</param>
42-
/// <returns>An object that should be disposed when the application terminates.</returns>
43-
[Obsolete("It is no longer required to provide the application context when calling Init. " +
44-
"This method may be removed in a future major release.")]
45-
public static IDisposable Init(AndroidContext context, SentryOptions options)
46-
{
47-
AppContext = context;
48-
return Init(options);
49-
}
50-
5123
private static void InitSentryAndroidSdk(SentryOptions options)
5224
{
5325
// Set default release and distribution

src/Sentry/Platforms/Cocoa/Extensions/UserExtensions.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@ public static SentryUser ToUser(this CocoaSdk.SentryUser user, IDiagnosticLogger
1111
Id = user.UserId,
1212
IpAddress = user.IpAddress,
1313
Username = user.Username,
14-
#pragma warning disable CS0618 // Type or member is obsolete
15-
Segment = user.Segment,
16-
#pragma warning restore CS0618 // Type or member is obsolete
1714
Other = user.Data.ToStringDictionary(logger)
1815
};
1916

@@ -25,9 +22,6 @@ public static CocoaSdk.SentryUser ToCocoaUser(this SentryUser user)
2522
UserId = user.Id,
2623
IpAddress = user.IpAddress,
2724
Username = user.Username,
28-
#pragma warning disable CS0618 // Type or member is obsolete
29-
Segment = user.Segment ?? "",
30-
#pragma warning restore CS0618 // Type or member is obsolete
3125
Data = user.Other.ToNullableNSDictionary()
3226
};
3327

src/Sentry/SentryUser.cs

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ public sealed class SentryUser : ISentryJsonSerializable
1515
private string? _username;
1616
private string? _email;
1717
private string? _ipAddress;
18-
private string? _segment;
1918
private IDictionary<string, string>? _other;
2019

2120
/// <summary>
@@ -82,23 +81,6 @@ public string? IpAddress
8281
}
8382
}
8483

85-
/// <summary>
86-
/// The segment the user belongs to.
87-
/// </summary>
88-
[Obsolete("This property is deprecated and will be removed in a future version.")]
89-
public string? Segment
90-
{
91-
get => _segment;
92-
set
93-
{
94-
if (_segment != value)
95-
{
96-
_segment = value;
97-
PropertyChanged?.Invoke(this);
98-
}
99-
}
100-
}
101-
10284
/// <summary>
10385
/// Additional information about the user.
10486
/// </summary>
@@ -137,9 +119,6 @@ internal void CopyTo(SentryUser? user)
137119
user.Username ??= Username;
138120
user.Email ??= Email;
139121
user.IpAddress ??= IpAddress;
140-
#pragma warning disable CS0618 // Type or member is obsolete
141-
user.Segment ??= Segment;
142-
#pragma warning restore CS0618 // Type or member is obsolete
143122

144123
user._other ??= _other?.ToDictionary(
145124
entry => entry.Key,
@@ -151,9 +130,6 @@ Id is not null ||
151130
Username is not null ||
152131
Email is not null ||
153132
IpAddress is not null ||
154-
#pragma warning disable CS0618 // Type or member is obsolete
155-
Segment is not null ||
156-
#pragma warning restore CS0618 // Type or member is obsolete
157133
_other?.Count > 0;
158134

159135
/// <inheritdoc />
@@ -165,9 +141,6 @@ public void WriteTo(Utf8JsonWriter writer, IDiagnosticLogger? _)
165141
writer.WriteStringIfNotWhiteSpace("username", Username);
166142
writer.WriteStringIfNotWhiteSpace("email", Email);
167143
writer.WriteStringIfNotWhiteSpace("ip_address", IpAddress);
168-
#pragma warning disable CS0618 // Type or member is obsolete
169-
writer.WriteStringIfNotWhiteSpace("segment", Segment);
170-
#pragma warning restore CS0618 // Type or member is obsolete
171144
writer.WriteStringDictionaryIfNotEmpty("other", _other!);
172145

173146
writer.WriteEndObject();
@@ -191,9 +164,6 @@ public static SentryUser FromJson(JsonElement json)
191164
Username = username,
192165
Email = email,
193166
IpAddress = ip,
194-
#pragma warning disable CS0618 // Type or member is obsolete
195-
Segment = segment,
196-
#pragma warning restore CS0618 // Type or member is obsolete
197167
_other = other?.WhereNotNullValue().ToDict()
198168
};
199169
}

test/Sentry.Tests/ApiApprovalTests.Run.DotNet6_0.verified.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -980,8 +980,6 @@ namespace Sentry
980980
public string? Id { get; set; }
981981
public string? IpAddress { get; set; }
982982
public System.Collections.Generic.IDictionary<string, string> Other { get; set; }
983-
[System.Obsolete("This property is deprecated and will be removed in a future version.")]
984-
public string? Segment { get; set; }
985983
public string? Username { get; set; }
986984
public Sentry.SentryUser Clone() { }
987985
public void WriteTo(System.Text.Json.Utf8JsonWriter writer, Sentry.Extensibility.IDiagnosticLogger? _) { }

test/Sentry.Tests/ApiApprovalTests.Run.DotNet7_0.verified.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -980,8 +980,6 @@ namespace Sentry
980980
public string? Id { get; set; }
981981
public string? IpAddress { get; set; }
982982
public System.Collections.Generic.IDictionary<string, string> Other { get; set; }
983-
[System.Obsolete("This property is deprecated and will be removed in a future version.")]
984-
public string? Segment { get; set; }
985983
public string? Username { get; set; }
986984
public Sentry.SentryUser Clone() { }
987985
public void WriteTo(System.Text.Json.Utf8JsonWriter writer, Sentry.Extensibility.IDiagnosticLogger? _) { }

test/Sentry.Tests/ApiApprovalTests.Run.DotNet8_0.verified.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -982,8 +982,6 @@ namespace Sentry
982982
public string? Id { get; set; }
983983
public string? IpAddress { get; set; }
984984
public System.Collections.Generic.IDictionary<string, string> Other { get; set; }
985-
[System.Obsolete("This property is deprecated and will be removed in a future version.")]
986-
public string? Segment { get; set; }
987985
public string? Username { get; set; }
988986
public Sentry.SentryUser Clone() { }
989987
public void WriteTo(System.Text.Json.Utf8JsonWriter writer, Sentry.Extensibility.IDiagnosticLogger? _) { }

0 commit comments

Comments
 (0)