Skip to content

Commit 2bac718

Browse files
committed
feat: uuid4 split for spanId
1 parent 99edb51 commit 2bac718

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/opentracing/src/spancontext.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ import { uuid4 } from '@sentry/utils/misc';
55
export class SpanContext {
66
public constructor(
77
public readonly traceId?: string,
8-
public readonly spanId: string = uuid4(), // private readonly parentId: string,
8+
public readonly spanId: string = uuid4().substring(16), // private readonly parentId: string,
99
) {}
1010

1111
/**
1212
* Returns debug version of the span.
1313
*/
1414
public toString(): string {
15-
return `TraceId: ${this.traceId} SpanId: ${this.spanId}`;
15+
return `${(this.traceId && `trace-id:${this.traceId};`) || ''}span-id:${this.spanId}`;
1616
}
1717
}

0 commit comments

Comments
 (0)