Skip to content
This repository was archived by the owner on Oct 3, 2023. It is now read-only.

Commit fe5a6aa

Browse files
committed
Change getContext to SpanBaseModel
1 parent 5e4ef9b commit fe5a6aa

2 files changed

Lines changed: 3 additions & 11 deletions

File tree

packages/opencensus-core/src/trace/model/root-span.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,6 @@ export class RootSpan extends SpanBaseModel implements OnEndSpanEventListener {
4747
return this._traceId;
4848
}
4949

50-
public getContext(): TraceContext {
51-
return <TraceContext>{
52-
traceId: this.traceId,
53-
spanId: this.id,
54-
parentSpanId: this.getParentSpanId
55-
}
56-
}
57-
5850
public start() {
5951
super.start()
6052
debug('starting %s %o', this._className, { traceId: this.traceId, id: this.id, parentSpanId: this.getParentSpanId() })

packages/opencensus-core/src/trace/types/tracetypes.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,11 +160,11 @@ export abstract class SpanBaseModel {
160160
}
161161

162162
public get traceContext(): TraceContext {
163-
return {
163+
return <TraceContext>{
164164
traceId: this.traceId.toString(),
165165
spanId: this.id.toString(),
166-
options: 1 // always traced
167-
};
166+
parentSpanId: this.getParentSpanId
167+
}
168168
}
169169

170170
//TODO: maybe key and values must be truncate

0 commit comments

Comments
 (0)