[Bug]: OpikExporter is not compatible with @vercel/otel
What component(s) are affected?
- [ ] Opik Python SDK
- [x] Opik Typescript SDK
- [ ] Opik Agent Optimizer SDK
- [ ] Opik UI
- [ ] Opik Server
- [ ] Documentation
Opik version
- Opik version: 1.8.52
Describe the problem
If we use OpikExporter with registerOTel, it throws TypeError: Cannot read properties of undefined (reading 'name') error.
It seems @vercel/otel doesn't support otel 2
https://github.com/vercel/otel/issues/154
So instrumentationScope can't be used but it was replaced on https://github.com/comet-ml/opik/pull/2174
Reproduction steps and code snippets
import { OpikExporter } from "opik/vercel";
import { registerOTel } from "@vercel/otel";
registerOTel({
traceExporter: new OpikExporter(),
});
Error logs or stack trace
TypeError: Cannot read properties of undefined (reading 'name')
at new Promise (<anonymous>)
⨯ unhandledRejection: TypeError: Cannot read properties of undefined (reading 'name')
at new Promise (<anonymous>)
⨯ unhandledRejection: TypeError: Cannot read properties of undefined (reading 'name')
at new Promise (<anonymous>)
Healthcheck results
No response
Hi @mtsmfm, could you share the version of your packages and Node? I cannot reproduce locally with those versions:
"dependencies": {
"@ai-sdk/openai": "^2.0.32",
"@vercel/otel": "^1.13.0",
"ai": "^5.0.49",
"opik": "^1.8.52"
},
@Lothiraldan Hi, here's the entire codes, hope it helps. https://github.com/mtsmfm/opik-3361
@Lothiraldan Any update on this bug? We are also facing the same issue.