Skip to content

Commit a03a1b3

Browse files
bmermetEmanuele Palazzetti
authored andcommitted
Rename parent as childof (#33)
1 parent e3163be commit a03a1b3

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/Datadog.Trace.Tests/TracerTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ public void StartActive_NoFinishOnClose_SpanIsNotFinishedWhenScopeIsClosed()
100100
public void StartActive_SetParentManually_ParentIsSet()
101101
{
102102
var parent = _tracer.StartSpan("Parent");
103-
var child = _tracer.StartActive("Child", parent: parent.Context);
103+
var child = _tracer.StartActive("Child", childOf: parent.Context);
104104

105105
Assert.Equal(parent.Context, child.Span.Context.Parent);
106106
}

src/Datadog.Trace/Implementations/Tracer.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -94,35 +94,35 @@ public Scope ActivateSpan(Span span, bool finishOnClose = true)
9494
/// This is a shortcut for <see cref="StartSpan"/> and <see cref="ActivateSpan"/>, it creates a new span with the given parameters and makes it active.
9595
/// </summary>
9696
/// <param name="operationName">The span's operation name</param>
97-
/// <param name="parent">The span's parent</param>
97+
/// <param name="childOf">The span's parent</param>
9898
/// <param name="serviceName">The span's service name</param>
9999
/// <param name="startTime">An explicit start time for that span</param>
100100
/// <param name="ignoreActiveScope">If set the span will not be a child of the currently active span</param>
101101
/// <param name="finishOnClose">If set to false, closing the returned scope will not close the enclosed span </param>
102102
/// <returns>A scope wrapping the newly created span</returns>
103-
public Scope StartActive(string operationName, SpanContext parent = null, string serviceName = null, DateTimeOffset? startTime = null, bool ignoreActiveScope = false, bool finishOnClose = true)
103+
public Scope StartActive(string operationName, SpanContext childOf = null, string serviceName = null, DateTimeOffset? startTime = null, bool ignoreActiveScope = false, bool finishOnClose = true)
104104
{
105-
var span = StartSpan(operationName, parent, serviceName, startTime, ignoreActiveScope);
105+
var span = StartSpan(operationName, childOf, serviceName, startTime, ignoreActiveScope);
106106
return _scopeManager.Activate(span, finishOnClose);
107107
}
108108

109109
/// <summary>
110110
/// This create a Span with the given parameters
111111
/// </summary>
112112
/// <param name="operationName">The span's operation name</param>
113-
/// <param name="parent">The span's parent</param>
113+
/// <param name="childOf">The span's parent</param>
114114
/// <param name="serviceName">The span's service name</param>
115115
/// <param name="startTime">An explicit start time for that span</param>
116116
/// <param name="ignoreActiveScope">If set the span will not be a child of the currently active span</param>
117117
/// <returns>The newly created span</returns>
118-
public Span StartSpan(string operationName, SpanContext parent = null, string serviceName = null, DateTimeOffset? startTime = null, bool ignoreActiveScope = false)
118+
public Span StartSpan(string operationName, SpanContext childOf = null, string serviceName = null, DateTimeOffset? startTime = null, bool ignoreActiveScope = false)
119119
{
120-
if (parent == null && !ignoreActiveScope)
120+
if (childOf == null && !ignoreActiveScope)
121121
{
122-
parent = _scopeManager.Active?.Span?.Context;
122+
childOf = _scopeManager.Active?.Span?.Context;
123123
}
124124

125-
var span = new Span(this, parent, operationName, serviceName, startTime);
125+
var span = new Span(this, childOf, operationName, serviceName, startTime);
126126
span.TraceContext.AddSpan(span);
127127
return span;
128128
}

0 commit comments

Comments
 (0)