refactor(span)!: gate addLink(spanContext, attributes) legacy overload off in v6#8319
Conversation
Overall package sizeSelf size: 5.82 MB Dependency sizes| name | version | self size | total size | |------|---------|-----------|------------| | import-in-the-middle | 3.0.1 | 82.56 kB | 817.39 kB | | dc-polyfill | 0.1.11 | 25.74 kB | 25.74 kB |🤖 This report was automatically generated by heaviest-objects-in-the-universe |
|
✨ Fix all issues with BitsAI or with Cursor
|
| * @param {Object} attributes An optional key value pair of arbitrary values. | ||
| * @returns {void} | ||
| */ | ||
| addLink (context: SpanContext, attributes?: Object): void; |
There was a problem hiding this comment.
Needs a review from @zacharycmontoya, if we have a rule how these should be handled.
There was a problem hiding this comment.
if we have a rule how these should be handled.
What do you mean? I think what you're doing is fine, as it's been marked as deprecated in the previous version and in the new version we are removing the API
|
System tests need an update |
v6 has not shipped yet, so the unqualified heading suggested a released migration. Refs: #8319 (comment)
BenchmarksBenchmark execution time: 2026-05-12 16:04:12 Comparing candidate commit 5baf8db in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 1509 metrics, 84 unstable metrics. |
…d off in v6
v5 keeps the OpenTracing-style positional shape; v6 only accepts `addLink({ context, attributes })` on both the OpenTracing `Span` and the OpenTelemetry bridge. Tests that exercised the legacy form switch to the canonical shape (works on both versions) or are gated with `DD_MAJOR < 6`.
`addLink(spanContext, attrs)` no longer works on v6 — the legacy
positional overload now TypeErrors on `context._ddContext`. Several
plugins (`kafkajs`, `google-cloud-pubsub`, `azure-*`), the OTel
`addSpanPointer` helper, and the `dd-trace-api` plugin spec still
passed that shape. They switch to `addLink({ context, attributes })`,
which also works on v5. `docs/test.ts` drops the two legacy-form
lines that no longer compile against the updated type definitions, and
the `version` import in `opentracing/span.js` moves above
`./span_context` to satisfy `import/order`. A `DD_MAJOR < 6`-gated
regression test on the OpenTracing `Span` pins the legacy v5 path so
v5 coverage stays after the canonical-only conversion in the
surrounding tests.
v6 has not shipped yet, so the unqualified heading suggested a released migration. Refs: #8319 (comment)
400e8f7 to
005c2dc
Compare
Co-authored-by: Ruben Bridgewater <[email protected]>
zacharycmontoya
left a comment
There was a problem hiding this comment.
The changes look good to me. I support aligning with the OTel AddLink method signature that takes a single Link argument
Summary
Span.addLink(both the OpenTracing API and the OpenTelemetry bridge) nolonger accepts the positional
(spanContext, attributes)shape on v6; onlyaddLink({ context, attributes })does. v5 keeps both shapes. The runtimebranch is gated with
DD_MAJOR < 6and the duplicate TS overloads onSpanand the OTel mirror are dropped. Existing tests that called the legacy form
switch to the canonical shape; the one OTel-bridge test specifically
exercising the deprecated shape is gated with
DD_MAJOR < 6.