Skip to content

feat: dd-trace 5.0 to 6.0 - rewrite Span.addLink object argument #2

@mohab-sameh

Description

@mohab-sameh

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions