File tree Expand file tree Collapse file tree 3 files changed +5
-11
lines changed Expand file tree Collapse file tree 3 files changed +5
-11
lines changed Original file line number Diff line number Diff line change @@ -287,7 +287,6 @@ export class Span implements SpanInterface, SpanContext {
287287 }
288288
289289 return this . _hub . captureEvent ( {
290- contexts : { trace : this . getTraceContext ( ) } ,
291290 spans : finishedSpans ,
292291 start_timestamp : this . startTimestamp ,
293292 tags : this . tags ,
@@ -312,22 +311,17 @@ export class Span implements SpanInterface, SpanContext {
312311 * @inheritDoc
313312 */
314313 public getTraceContext ( ) : object {
315- const context = {
314+ return {
316315 data : this . data ,
317316 description : this . description ,
318317 op : this . op ,
319318 parent_span_id : this . _parentSpanId ,
320319 span_id : this . _spanId ,
320+ // Undefined status will be dropped by `JSON.stringify` anyway so it's safe to read it directly like that
321+ status : this . tags . status ,
321322 tags : this . tags ,
322323 trace_id : this . _traceId ,
323324 } ;
324-
325- if ( this . tags . status ) {
326- // TODO: Fixme, just use better typings
327- ( context as any ) . status = this . tags . status ;
328- }
329-
330- return context ;
331325 }
332326
333327 /**
Original file line number Diff line number Diff line change @@ -329,7 +329,7 @@ export class Scope implements ScopeInterface {
329329 }
330330 if ( this . _span ) {
331331 event . contexts = event . contexts || { } ;
332- event . contexts . trace = this . _span ;
332+ event . contexts . trace = this . _span . getTraceContext ( ) ;
333333 }
334334
335335 this . _applyFingerprint ( event ) ;
Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ export interface SpanContext {
5454 /**
5555 * Completion status of the Span.
5656 */
57- status ?: boolean ;
57+ status ?: SpanStatus ;
5858 /**
5959 * Parent Span ID
6060 */
You can’t perform that action at this time.
0 commit comments