Description
Please make sure you have searched for information in the following guides.
- Search the issues already opened: https://github.com/GoogleCloudPlatform/google-cloud-node/issues
- Search StackOverflow: http://stackoverflow.com/questions/tagged/google-cloud-platform+node.js
- Check our Troubleshooting guide: https://github.com/googleapis/google-cloud-node/blob/main/docs/troubleshooting.md
- Check our FAQ: https://github.com/googleapis/google-cloud-node/blob/main/docs/faq.md
- Check our libraries HOW-TO: https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md
- Check out our authentication guide: https://github.com/googleapis/google-auth-library-nodejs
- Check out handwritten samples for many of our APIs: https://github.com/GoogleCloudPlatform/nodejs-docs-samples
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.
- npm install
- npm start
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/[email protected], 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.