diff --git a/src/Datadog.Trace.Tests/TracerTests.cs b/src/Datadog.Trace.Tests/TracerTests.cs index 9bc894f489e0..685640df331f 100644 --- a/src/Datadog.Trace.Tests/TracerTests.cs +++ b/src/Datadog.Trace.Tests/TracerTests.cs @@ -88,7 +88,7 @@ public void StartActive_NoFinishOnClose_SpanIsNotFinishedWhenScopeIsClosed() public void StartActive_SetParentManually_ParentIsSet() { var parent = _tracer.StartSpan("Parent"); - var child = _tracer.StartActive("Child", parent: parent.Context); + var child = _tracer.StartActive("Child", childOf: parent.Context); Assert.Equal(parent.Context, child.Span.Context.Parent); } diff --git a/src/Datadog.Trace/Implementations/Tracer.cs b/src/Datadog.Trace/Implementations/Tracer.cs index 0fd84120b589..ccb57a5e2c7d 100644 --- a/src/Datadog.Trace/Implementations/Tracer.cs +++ b/src/Datadog.Trace/Implementations/Tracer.cs @@ -94,15 +94,15 @@ public Scope ActivateSpan(Span span, bool finishOnClose = true) /// This is a shortcut for and , it creates a new span with the given parameters and makes it active. /// /// The span's operation name - /// The span's parent + /// The span's parent /// The span's service name /// An explicit start time for that span /// If set the span will not be a child of the currently active span /// If set to false, closing the returned scope will not close the enclosed span /// A scope wrapping the newly created span - public Scope StartActive(string operationName, SpanContext parent = null, string serviceName = null, DateTimeOffset? startTime = null, bool ignoreActiveScope = false, bool finishOnClose = true) + public Scope StartActive(string operationName, SpanContext childOf = null, string serviceName = null, DateTimeOffset? startTime = null, bool ignoreActiveScope = false, bool finishOnClose = true) { - var span = StartSpan(operationName, parent, serviceName, startTime, ignoreActiveScope); + var span = StartSpan(operationName, childOf, serviceName, startTime, ignoreActiveScope); return _scopeManager.Activate(span, finishOnClose); } @@ -110,19 +110,19 @@ public Scope StartActive(string operationName, SpanContext parent = null, string /// This create a Span with the given parameters /// /// The span's operation name - /// The span's parent + /// The span's parent /// The span's service name /// An explicit start time for that span /// If set the span will not be a child of the currently active span /// The newly created span - public Span StartSpan(string operationName, SpanContext parent = null, string serviceName = null, DateTimeOffset? startTime = null, bool ignoreActiveScope = false) + public Span StartSpan(string operationName, SpanContext childOf = null, string serviceName = null, DateTimeOffset? startTime = null, bool ignoreActiveScope = false) { - if (parent == null && !ignoreActiveScope) + if (childOf == null && !ignoreActiveScope) { - parent = _scopeManager.Active?.Span?.Context; + childOf = _scopeManager.Active?.Span?.Context; } - var span = new Span(this, parent, operationName, serviceName, startTime); + var span = new Span(this, childOf, operationName, serviceName, startTime); span.TraceContext.AddSpan(span); return span; }