Skip to content

Commit a1b96d9

Browse files
Merge branch 'version-5.0.0' into substring-or-pattern-matcher
2 parents 2b5cd57 + e2967f0 commit a1b96d9

24 files changed

+31
-144
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Changelog
22

3+
## Version Five
4+
5+
### 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))
9+
- 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))
10+
311
## 4.10.2
412

513
### Various fixes & improvements

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/IBaseTracer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
namespace Sentry;
22

3-
internal interface IBaseTracer : ITraceContextInternal
3+
internal interface IBaseTracer
44
{
55
internal bool IsOtelInstrumenter { get; }
66
}

src/Sentry/ITraceContextInternal.cs

Lines changed: 0 additions & 19 deletions
This file was deleted.

src/Sentry/Internal/NoOpSpan.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ namespace Sentry.Internal;
55
/// <summary>
66
/// Span class to use when we can't return null but a request to create a span couldn't be completed.
77
/// </summary>
8-
internal class NoOpSpan : ISpan, ITraceContextInternal
8+
internal class NoOpSpan : ISpan
99
{
1010
public static ISpan Instance { get; } = new NoOpSpan();
1111

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/Facades/TransactionContextFacade.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ internal TransactionContextFacade(JavaSdk.TransactionContext context)
2525

2626
public string Operation => _context.Operation;
2727

28+
public string? Origin => _context.Origin;
29+
2830
public string? Description => _context.Description;
2931

3032
public SpanStatus? Status => _context.Status?.ToSpanStatus();

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

0 commit comments

Comments
 (0)