@@ -71,6 +71,11 @@ export class Span implements SpanInterface, SpanContext {
71
71
*/
72
72
private readonly _parentSpanId ?: string ;
73
73
74
+ /**
75
+ * Internal keeper of the status
76
+ */
77
+ private _status ?: SpanStatus ;
78
+
74
79
/**
75
80
* @inheritDoc
76
81
*/
@@ -153,6 +158,9 @@ export class Span implements SpanInterface, SpanContext {
153
158
if ( spanContext . tags ) {
154
159
this . tags = spanContext . tags ;
155
160
}
161
+ if ( spanContext . status ) {
162
+ this . _status = spanContext . status ;
163
+ }
156
164
}
157
165
158
166
/**
@@ -229,7 +237,7 @@ export class Span implements SpanInterface, SpanContext {
229
237
* @inheritDoc
230
238
*/
231
239
public setStatus ( value : SpanStatus ) : this {
232
- this . setTag ( 'status' , value ) ;
240
+ this . _status = value ;
233
241
return this ;
234
242
}
235
243
@@ -249,7 +257,7 @@ export class Span implements SpanInterface, SpanContext {
249
257
* @inheritDoc
250
258
*/
251
259
public isSuccess ( ) : boolean {
252
- return this . tags . status === SpanStatus . Ok ;
260
+ return this . _status === SpanStatus . Ok ;
253
261
}
254
262
255
263
/**
@@ -333,7 +341,7 @@ export class Span implements SpanInterface, SpanContext {
333
341
op : this . op ,
334
342
parent_span_id : this . _parentSpanId ,
335
343
span_id : this . _spanId ,
336
- status : this . tags . status ,
344
+ status : this . _status ,
337
345
tags : Object . keys ( this . tags ) . length > 0 ? this . tags : undefined ,
338
346
trace_id : this . _traceId ,
339
347
} ) ;
0 commit comments