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

Commit abad01f

Browse files
committed
Make spans in a trace private
1 parent 0790f49 commit abad01f

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

  • packages/opencensus-core/src/trace/model

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,16 @@ import {TraceBaseModel} from '../types/tracetypes'
2323

2424
export class Trace extends TraceBaseModel {
2525

26-
private spans: Span[] = [];
26+
private _spans: Span[] = [];
2727
private _traceId: string;
2828

2929
constructor() {
3030
super()
3131
this._traceId = (uuid.v4().split('-').join(''));
3232
}
3333

34-
public get traceSpans() : Span[] {
35-
return this.spans;
34+
public get spans() : Span[] {
35+
return this._spans;
3636
}
3737

3838
public get traceId() : string {
@@ -48,7 +48,7 @@ export class Trace extends TraceBaseModel {
4848
super.end()
4949

5050
//TODO - Define logic for list of spans
51-
this.spans.forEach(function (span) {
51+
this._spans.forEach(function (span) {
5252
if (span.ended || !span.started) return
5353
span.truncate()
5454
})
@@ -66,7 +66,7 @@ export class Trace extends TraceBaseModel {
6666
newSpan.name = name
6767
newSpan.type = type
6868
newSpan.start();
69-
this.spans.push(newSpan);
69+
this._spans.push(newSpan);
7070
return newSpan;
7171
}
7272

0 commit comments

Comments
 (0)