Skip to content

Commit a20dd4c

Browse files
Merge branch 'feat/4.0.0' into feat/4.0.0-remove-hasbreadcrumbs
2 parents a0b2ff3 + 300f248 commit a20dd4c

File tree

12 files changed

+26
-37
lines changed

12 files changed

+26
-37
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ without native/platform specific bindings and SDKs. See [this ticket for more de
1717
API Changes:
1818

1919
- IHasBreadcrumbs was removed. Use IEventLike instead. ([#2670](https://github.com/getsentry/sentry-dotnet/pull/2670))
20+
- ISpanContext was removed. Use ITraceContext instead. ([#2668](https://github.com/getsentry/sentry-dotnet/pull/2668))
21+
- Removed IHasTransactionNameSource. Use ITransactionContext instead. ([#2654](https://github.com/getsentry/sentry-dotnet/pull/2654))
2022
- Adding `Distribution` to `IEventLike` ([#2660](https://github.com/getsentry/sentry-dotnet/pull/2660))
2123

2224
### Features

src/Sentry/IHasTransactionNameSource.cs

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

src/Sentry/ISpanContext.cs

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

src/Sentry/ISpanData.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1+
using Sentry.Protocol;
2+
13
namespace Sentry;
24

35
/// <summary>
46
/// Immutable data belonging to a span.
57
/// </summary>
6-
public interface ISpanData : ISpanContext, IHasTags, IHasExtra
8+
public interface ISpanData : ITraceContext, IHasTags, IHasExtra
79
{
810
/// <summary>
911
/// Start timestamp.

src/Sentry/ITransactionContext.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1+
using Sentry.Protocol;
2+
13
namespace Sentry;
24

35
/// <summary>
46
/// Transaction metadata.
57
/// </summary>
6-
public interface ITransactionContext : ISpanContext
8+
public interface ITransactionContext : ITraceContext
79
{
810
/// <summary>
911
/// Transaction name.
@@ -14,4 +16,9 @@ public interface ITransactionContext : ISpanContext
1416
/// Whether the parent transaction of this transaction has been sampled.
1517
/// </summary>
1618
bool? IsParentSampled { get; }
19+
20+
/// <summary>
21+
/// The source of the transaction name.
22+
/// </summary>
23+
TransactionNameSource NameSource { get; }
1724
}

src/Sentry/Internal/NoOpTransaction.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ public bool? IsParentSampled
2525
set { }
2626
}
2727

28+
public TransactionNameSource NameSource => TransactionNameSource.Custom;
29+
2830
public string? Distribution
2931
{
3032
get => string.Empty;

src/Sentry/SpanContext.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1+
using Sentry.Protocol;
2+
13
namespace Sentry;
24

35
/// <summary>
46
/// Span metadata used for sampling.
57
/// </summary>
6-
public class SpanContext : ISpanContext
8+
public class SpanContext : ITraceContext
79
{
810
/// <inheritdoc />
911
public SpanId SpanId { get; }

src/Sentry/Transaction.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace Sentry;
99
/// <summary>
1010
/// Sentry performance transaction.
1111
/// </summary>
12-
public class Transaction : ITransactionData, IJsonSerializable, IHasTransactionNameSource, IHasMeasurements
12+
public class Transaction : ITransactionData, IJsonSerializable, IHasMeasurements
1313
{
1414
/// <summary>
1515
/// Transaction's event ID.
@@ -233,7 +233,7 @@ public Transaction(string name, string operation, TransactionNameSource nameSour
233233
/// Initializes an instance of <see cref="Transaction"/>.
234234
/// </summary>
235235
public Transaction(ITransaction tracer)
236-
: this(tracer.Name, tracer is IHasTransactionNameSource t ? t.NameSource : TransactionNameSource.Custom)
236+
: this(tracer.Name, tracer.NameSource)
237237
{
238238
// Contexts have to be set first because other fields use that
239239
Contexts = tracer.Contexts;

src/Sentry/TransactionContext.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ namespace Sentry;
33
/// <summary>
44
/// Transaction metadata used for sampling.
55
/// </summary>
6-
public class TransactionContext : SpanContext, ITransactionContext, IHasTransactionNameSource
6+
public class TransactionContext : SpanContext, ITransactionContext
77
{
88
/// <inheritdoc />
99
public string Name { get; set; }

src/Sentry/TransactionTracer.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace Sentry;
77
/// <summary>
88
/// Transaction tracer.
99
/// </summary>
10-
public class TransactionTracer : ITransaction, IHasTransactionNameSource, IHasMeasurements
10+
public class TransactionTracer : ITransaction, IHasMeasurements
1111
{
1212
private readonly IHub _hub;
1313
private readonly SentryOptions? _options;
@@ -43,7 +43,7 @@ public SentryId TraceId
4343
/// <inheritdoc cref="ITransaction.Name" />
4444
public string Name { get; set; }
4545

46-
/// <inheritdoc cref="IHasTransactionNameSource.NameSource" />
46+
/// <inheritdoc cref="ITransactionContext.NameSource" />
4747
public TransactionNameSource NameSource { get; set; }
4848

4949
/// <inheritdoc cref="ITransaction.IsParentSampled" />
@@ -229,7 +229,7 @@ internal TransactionTracer(IHub hub, ITransactionContext context, TimeSpan? idle
229229
_hub = hub;
230230
_options = _hub.GetSentryOptions();
231231
Name = context.Name;
232-
NameSource = context is IHasTransactionNameSource c ? c.NameSource : TransactionNameSource.Custom;
232+
NameSource = context.NameSource;
233233
Operation = context.Operation;
234234
SpanId = context.SpanId;
235235
ParentSpanId = context.ParentSpanId;

0 commit comments

Comments
 (0)