Summary
Rewrite the removed Span.addLink(spanContext, attributes) overload to the v6
single-argument shape.
Detection Criteria
Find .addLink(...) member calls with exactly two positional arguments when the
receiver is a Datadog span factory result, a local variable initialized from one,
or a parameter typed as Span imported from dd-trace.
Transformation Logic
Replace the two arguments with one object literal:
{ context: <first-arg>, attributes: <second-arg> }.
Before / After Example
span.addLink(otherSpan.context(), { foo: "bar" });
span.addLink({ context: otherSpan.context(), attributes: { foo: "bar" } });
Notes / Edge Cases
Skip calls that already use the object shape or have any arity other than two.
Summary
Rewrite the removed
Span.addLink(spanContext, attributes)overload to the v6single-argument shape.
Detection Criteria
Find
.addLink(...)member calls with exactly two positional arguments when thereceiver is a Datadog span factory result, a local variable initialized from one,
or a parameter typed as
Spanimported fromdd-trace.Transformation Logic
Replace the two arguments with one object literal:
{ context: <first-arg>, attributes: <second-arg> }.Before / After Example
Notes / Edge Cases
Skip calls that already use the object shape or have any arity other than two.