Skip to content

Commit

Permalink
Made most of the SpanContext constructor parameters optional
Browse files Browse the repository at this point in the history
  • Loading branch information
jamescrosswell committed Oct 11, 2023
1 parent 9873fb0 commit b723ca0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/Sentry.OpenTelemetry/SentrySpanProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ public override void OnStart(Activity data)
{
// We can find the parent span - start a child span.
var context = new SpanContext(
data.OperationName,
data.SpanId.AsSentrySpanId(),
data.ParentSpanId.AsSentrySpanId(),
data.TraceId.AsSentryId(),
data.OperationName,
data.DisplayName,
null,
null)
Expand Down
12 changes: 6 additions & 6 deletions src/Sentry/SpanContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ public class SpanContext : ITraceContext
/// Initializes an instance of <see cref="SpanContext"/>.
/// </summary>
public SpanContext(
SpanId? spanId,
SpanId? parentSpanId,
SentryId? traceId,
string operation,
string? description,
SpanStatus? status,
bool? isSampled)
SpanId? spanId = null,
SpanId? parentSpanId = null,
SentryId? traceId = null,
string? description = null,
SpanStatus? status = null,
bool? isSampled = null)
{
SpanId = spanId ?? SpanId.Create();
ParentSpanId = parentSpanId;
Expand Down
2 changes: 1 addition & 1 deletion src/Sentry/TransactionContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public class TransactionContext : SpanContext, ITransactionContext
bool? isParentSampled = null,
TransactionNameSource nameSource = TransactionNameSource.Custom
)
: base(spanId, parentSpanId, traceId, operation, description, status, isSampled)
: base(operation, spanId, parentSpanId, traceId, description, status, isSampled)
{
Name = name;
IsParentSampled = isParentSampled;
Expand Down

0 comments on commit b723ca0

Please sign in to comment.