Skip to content

Commit 095c856

Browse files
committed
rename variable, propagate transaction property
1 parent 564269f commit 095c856

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

packages/tracing/src/span.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -167,19 +167,21 @@ export class Span implements SpanInterface, SpanContext {
167167
public startChild(
168168
spanContext?: Pick<SpanContext, Exclude<keyof SpanContext, 'spanId' | 'sampled' | 'traceId' | 'parentSpanId'>>,
169169
): Span {
170-
const span = new Span({
170+
const childSpan = new Span({
171171
...spanContext,
172172
parentSpanId: this.spanId,
173173
sampled: this.sampled,
174174
traceId: this.traceId,
175175
});
176176

177-
span.spanRecorder = this.spanRecorder;
178-
if (span.spanRecorder) {
179-
span.spanRecorder.add(span);
177+
childSpan.spanRecorder = this.spanRecorder;
178+
if (childSpan.spanRecorder) {
179+
childSpan.spanRecorder.add(childSpan);
180180
}
181181

182-
return span;
182+
childSpan.transaction = this.transaction;
183+
184+
return childSpan;
183185
}
184186

185187
/**

0 commit comments

Comments
 (0)