documentation/internals/span-links.md
Span links are supported in our agent primarily to support the propagation of span link metadata from Open Telemetry instrumentations. A span link describes how to link an entity to the transaction that produced it. This is most common in distributed messaging systems:
lib/otel/traces/segment-synthesis:
The final step of the synthesize method attaches links to the current
trace segment.lib/spans/span-event:
The createSpan method propagates links from the trace segment to the span.lib/spans/span-event-aggregator:
The _toPayloadSync method injects span links into the events data subsequent
to the span they are attached to.The _toPayloadSync method is what is invoked at harvest time. The result
is the data structure that is sent to the collector.