Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

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

Open Beginner friendly
#2,552 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
85/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
typescript
Domain
observability

Research direction

Start in src/instrumentation/plugins/eve-instrumentation.ts at the turn-started handler, then compare its handling with the parentTraceContext field described for Eve's turn.started event. Done means a turn with parentTraceContext and no parentLineage nests under the supplied trace and span IDs, while existing parentLineage and root-span behavior remain unchanged.

Written by the indexing model from the issue text.

Description

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.

Dominant language
TypeScript
Stars
28
Forks
14
Avg merge
1d 23h
Merged PRs (30d)
71

Getting set up

  • Ships a Dockerfile or Docker Compose file
  • No pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from braintrustdata/braintrust-sdk-javascript

All issues in braintrustdata/braintrust-sdk-javascript

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.