Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

Eve provider ignores parentTraceContext, so eve.turn is always a root span

Geschlossen Anfängerfreundlich
#2,552 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Anfängerfreundlichkeit
85/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
typescript
Bereich
observability

Rechercherichtung

Beginne in src/instrumentation/plugins/eve-instrumentation.ts beim turn-started-Handler und vergleiche anschließend dessen Verarbeitung mit dem parentTraceContext-Feld, das für Eves turn.started-Ereignis beschrieben ist. Als erledigt gilt die Änderung, wenn ein Turn mit parentTraceContext und ohne parentLineage unter den angegebenen Trace- und Span-IDs verschachtelt wird, während das bestehende Verhalten von parentLineage und Root-Span unverändert bleibt.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Summary

braintrustEveInstrumentation() always starts eve.turn as a root span, so Eve sessions created inside a traced request show up as separate traces instead of nesting under the caller's span.

Eve already propagates the caller's context. When a session request carries a W3C traceparent, Eve (0.56) sets parentTraceContext on the provider's turn.started event (dist/src/instrumentation/native-events.js). The SDK declares the field on EveProviderTurnStartedEvent (3.35.0, index.d.ts), but the provider bridge's turn-started handler in src/instrumentation/plugins/eve-instrumentation.ts never reads it. When parentLineage is absent, it always uses:

parentSpanIds: { parentSpanIds: [], rootSpanId }   // rootSpanId = this turn's own spanId

startSpan also runs under withCurrent(NOOP_SPAN, ...), so async context can't supply a parent either.

Expected

If turn.started has parentTraceContext and no parentLineage, parent the turn to it:

parentSpanIds: { rootSpanId: parentTraceContext.traceId, spanId: parentTraceContext.spanId }

This assumes the caller's span IDs are W3C-compatible (OTel ID mode), so injectTraceContext() on the caller and Eve's traceparent handling line up. If parentTraceContext.traceFlags marks the context as unsampled, Eve already drops the session, so nothing else is needed.

Repro

  1. Inside traced(...) in a Next.js route, create an Eve session through eve/client and send a traceparent header from injectTraceContext().
  2. Eve 0.56 server with braintrustEveInstrumentation({ metadata }) exported from agent/instrumentation.
  3. In Braintrust logs, eve.turn is the root of its own trace. You can only find it from the caller's trace by searching for eve.session_id.

Versions

  • braintrust 3.33.0 and 3.35.0
  • eve 0.56.0

Why it matters

Online scoring rules on the caller's span can't see Eve's tool calls, such as data an agent loads from its sandbox. Following one request currently means jumping between traces by eve.session_id.

Vorherrschende Sprache
TypeScript
Sterne
29
Forks
16
Ø Merge
1 T. 15 Std.
Gemergte PRs (30 T.)
69

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.