@@ -44,12 +44,13 @@ export class NativeSpan implements Tracer.Span {
4444 status : Tracer . SpanStatus
4545 attributes : Map < string , unknown >
4646 events : Array < [ name : string , startTime : bigint , attributes : Record < string , unknown > ] > = [ ]
47+ links : Array < Tracer . SpanLink >
4748
4849 constructor (
4950 readonly name : string ,
5051 readonly parent : Option . Option < Tracer . AnySpan > ,
5152 readonly context : Context . Context < never > ,
52- readonly links : ReadonlyArray < Tracer . SpanLink > ,
53+ links : Iterable < Tracer . SpanLink > ,
5354 readonly startTime : bigint ,
5455 readonly kind : Tracer . SpanKind
5556 ) {
@@ -60,6 +61,7 @@ export class NativeSpan implements Tracer.Span {
6061 this . attributes = new Map ( )
6162 this . traceId = parent . _tag === "Some" ? parent . value . traceId : randomHexString ( 32 )
6263 this . spanId = randomHexString ( 16 )
64+ this . links = Array . from ( links )
6365 }
6466
6567 end ( endTime : bigint , exit : Exit . Exit < unknown , unknown > ) : void {
@@ -78,6 +80,11 @@ export class NativeSpan implements Tracer.Span {
7880 event ( name : string , startTime : bigint , attributes ?: Record < string , unknown > ) : void {
7981 this . events . push ( [ name , startTime , attributes ?? { } ] )
8082 }
83+
84+ addLinks ( links : ReadonlyArray < Tracer . SpanLink > ) : void {
85+ // eslint-disable-next-line no-restricted-syntax
86+ this . links . push ( ...links )
87+ }
8188}
8289
8390/** @internal */
0 commit comments