Eve provider ignores parentTraceContext, so eve.turn is always a root span
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
- Inside
traced(...)in a Next.js route, create an Eve session througheve/clientand send atraceparentheader frominjectTraceContext(). - Eve 0.56 server with
braintrustEveInstrumentation({ metadata })exported fromagent/instrumentation. - In Braintrust logs,
eve.turnis the root of its own trace. You can only find it from the caller's trace by searching foreve.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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from braintrustdata/braintrust-sdk-javascript
-
Difficulty 4/5 3-5 days Newbie friendliness 55/100
braintrustdata/braintrust-sdk-javascript#2527 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 65/100
braintrustdata/braintrust-sdk-javascript#2526 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 56/100
braintrustdata/braintrust-sdk-javascript#2482 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 68/100
braintrustdata/braintrust-sdk-javascript#2481 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 58/100
braintrustdata/braintrust-sdk-javascript#2480 ·
Maintainers usually reply within 1 day
All issues in braintrustdata/braintrust-sdk-javascript
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Doist/todoist-cli#576 ·
Maintainers usually reply within 1 day
-
feature
Difficulty 1/5 Under an hour Newbie friendliness 72/100
vercel-labs/skills#2370 ·
Maintainers usually reply within 1 day
-
🐛 Bug supabase/cli
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
CopilotKit/aimock#491 ·
Maintainers usually reply within 1 day