@braintrust/otel can't be installed alongside OpenTelemetry JS 3

未关闭
#2,745 0 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

维护者通常 1 天内回复

@lforst 已经在做这个了。

开始于 2026年11月6日。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
57/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
领域
backend, testing

调研方向

Start with src/otel.ts and the existing otel-v1/ and otel-v2/ test environments; the issue describes the missing runtime import and an OTel 3 install failure. Check how the current environments test peer dependency compatibility, then verify installation and tests against OTel 3. Done means @braintrust/otel can install with the listed OTel 3 packages and resolve BatchSpanProcessor from the supported SDK.

由索引模型根据 Issue 内容生成。

描述

@braintrust/otel 1.1.0 can't be installed in an app that uses OpenTelemetry JS 3, released on 20 October.

Repro
mkdir bt-otel3 && cd bt-otel3 && npm init -y
npm install braintrust @braintrust/otel @opentelemetry/[email protected] @opentelemetry/[email protected] @opentelemetry/[email protected]
# npm error ERESOLVE unable to resolve dependency tree
# peer @opentelemetry/api@">=1.3.0 <1.10.0" from @opentelemetry/[email protected]

braintrust 3.43.0, Node 25.6.1, npm 11.

Cause

OpenTelemetry JS 3 removed @opentelemetry/sdk-trace-base. It is frozen at 2.12.0, which peers @opentelemetry/api <1.10.0, and its classes moved to @opentelemetry/sdk-trace. @braintrust/otel declares sdk-trace-base as a required peer, and src/otel.ts imports BatchSpanProcessor from it at runtime, so there is no install that satisfies both it and an OTel 3 stack.

A possible fix, in the package's existing pattern
  • Add an otel-v3/ test environment next to otel-v1/ and otel-v2/.
  • Make @opentelemetry/sdk-trace-base an optional peer, and add @opentelemetry/sdk-trace as an optional peer.
  • Resolve BatchSpanProcessor from @opentelemetry/sdk-trace when present, otherwise from sdk-trace-base. ReadableSpan and SpanProcessor are only used as types.

Would you take that, or would you rather ship OTel 3 support another way (for example a separate entry point)? I'm happy to open the PR either way.

主要语言
TypeScript
星标
29
派生
22
平均合并
1 天 25 分钟
30 天内合并 PR
80

环境准备

  • 提供 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 没有贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

braintrustdata/braintrust-sdk-javascript 的其他 Issue

查看 braintrustdata/braintrust-sdk-javascript 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。