@@ -71,6 +71,11 @@ export class Span implements SpanInterface, SpanContext {
7171 */
7272 private readonly _parentSpanId ?: string ;
7373
74+ /**
75+ * Internal keeper of the status
76+ */
77+ private _status ?: SpanStatus ;
78+
7479 /**
7580 * @inheritDoc
7681 */
@@ -153,6 +158,9 @@ export class Span implements SpanInterface, SpanContext {
153158 if ( spanContext . tags ) {
154159 this . tags = spanContext . tags ;
155160 }
161+ if ( spanContext . status ) {
162+ this . _status = spanContext . status ;
163+ }
156164 }
157165
158166 /**
@@ -229,7 +237,7 @@ export class Span implements SpanInterface, SpanContext {
229237 * @inheritDoc
230238 */
231239 public setStatus ( value : SpanStatus ) : this {
232- this . setTag ( 'status' , value ) ;
240+ this . _status = value ;
233241 return this ;
234242 }
235243
@@ -249,7 +257,7 @@ export class Span implements SpanInterface, SpanContext {
249257 * @inheritDoc
250258 */
251259 public isSuccess ( ) : boolean {
252- return this . tags . status === SpanStatus . Ok ;
260+ return this . _status === SpanStatus . Ok ;
253261 }
254262
255263 /**
@@ -333,7 +341,7 @@ export class Span implements SpanInterface, SpanContext {
333341 op : this . op ,
334342 parent_span_id : this . _parentSpanId ,
335343 span_id : this . _spanId ,
336- status : this . tags . status ,
344+ status : this . _status ,
337345 tags : Object . keys ( this . tags ) . length > 0 ? this . tags : undefined ,
338346 trace_id : this . _traceId ,
339347 } ) ;
0 commit comments