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

Offen
#2,745 0 Kommentare 0 Reaktionen 1 zugewiesene Person Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

@lforst arbeitet bereits daran.

Seit 06.11.2026.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
57/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
node.js, typescript
Bereich
backend, testing

Rechercherichtung

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.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

@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.

Vorherrschende Sprache
TypeScript
Sterne
29
Forks
22
Ø Merge
1 T. 25 Min.
Gemergte PRs (30 T.)
80

Entwicklungsumgebung

  • Enthält ein Dockerfile oder eine Docker-Compose-Datei
  • Keine Pull-Request-Vorlage
  • Kein Beitragsleitfaden

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus braintrustdata/braintrust-sdk-javascript

Alle Issues in braintrustdata/braintrust-sdk-javascript

Ähnliche Issues

Weitere Issues zu TypeScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.