opik icon indicating copy to clipboard operation
opik copied to clipboard

[Bug]: OpikExporter is not compatible with @vercel/otel

Open mtsmfm opened this issue 3 months ago • 3 comments

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

mtsmfm avatar Sep 23 '25 08:09 mtsmfm

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 avatar Sep 23 '25 08:09 Lothiraldan

@Lothiraldan Hi, here's the entire codes, hope it helps. https://github.com/mtsmfm/opik-3361

mtsmfm avatar Sep 23 '25 08:09 mtsmfm

@Lothiraldan Any update on this bug? We are also facing the same issue.

msp-ampcome avatar Oct 15 '25 12:10 msp-ampcome