Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

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

Chiusa Adatta ai principianti
#2,552 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
85/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
typescript
Ambito
observability

Direzione di ricerca

Inizia in src/instrumentation/plugins/eve-instrumentation.ts, nell’handler turn-started, quindi confronta la sua gestione con il campo parentTraceContext descritto per l’evento turn.started di Eve. Il lavoro è completato quando un turn con parentTraceContext e senza parentLineage viene annidato sotto gli ID di trace e span forniti, mentre il comportamento esistente di parentLineage e del root span rimane invariato.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
TypeScript
Stelle
28
Fork
15
Merge medio
1g 22h
PR unite (30g)
73

Preparare l'ambiente

  • Include un Dockerfile o un file Docker Compose
  • Nessun modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di braintrustdata/braintrust-sdk-javascript

Tutte le issue di braintrustdata/braintrust-sdk-javascript

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.