Please make sure you have searched for information in the following guides.
A screenshot that you have tested with "Try this API".
N/A
Link to the code that reproduces this issue. A link to a public Github Repository or gist with a minimal reproduction.
https://github.com/nicole0707/otel-addlink-compat-repro
A step-by-step description of how to reproduce the issue, based on the linked reproduction.
A clear and concise description of what the bug is, and what you expected to happen.
When using @vercel/otel for OpenTelemetry initialization, spans do not support the .addLink() method.
In the PubsubSpans.createPublishRpcSpan() and similar methods, addLink is called unguarded. However, Vercel’s OTEL wrapper currently uses @opentelemetry/api@1.0.0, which does not support addLink() on the span object.
This leads to runtime errors:
TypeError: span.addLink is not a function
Expected behavior:
The library should check whether .addLink is supported before calling it.
This would allow compatibility with OTEL wrappers like @vercel/otel, even if they’re on older SDK versions.
A clear and concise description WHY you expect this behavior, i.e., was it a recent change, there is documentation that points to this behavior, etc. **
The OpenTelemetry spec introduced Span.addLink() more recently, and not all implementations support it yet, particularly lightweight wrappers like Vercel’s.
Please make sure you have searched for information in the following guides.
A screenshot that you have tested with "Try this API".
N/A
Link to the code that reproduces this issue. A link to a public Github Repository or gist with a minimal reproduction.
https://github.com/nicole0707/otel-addlink-compat-repro
A step-by-step description of how to reproduce the issue, based on the linked reproduction.
A clear and concise description of what the bug is, and what you expected to happen.
When using @vercel/otel for OpenTelemetry initialization, spans do not support the .addLink() method.
In the PubsubSpans.createPublishRpcSpan() and similar methods, addLink is called unguarded. However, Vercel’s OTEL wrapper currently uses @opentelemetry/api@1.0.0, which does not support addLink() on the span object.
This leads to runtime errors:
Expected behavior:
The library should check whether
.addLinkis supported before calling it.This would allow compatibility with OTEL wrappers like @vercel/otel, even if they’re on older SDK versions.
A clear and concise description WHY you expect this behavior, i.e., was it a recent change, there is documentation that points to this behavior, etc. **
The OpenTelemetry spec introduced Span.addLink() more recently, and not all implementations support it yet, particularly lightweight wrappers like Vercel’s.