evals(v4): braintrust tracedSpan OTEL branch - #2760
Open
miguelg719 wants to merge 1 commit into
Open
Conversation
|
Contributor
There was a problem hiding this comment.
All reported issues were addressed across 1 file
Architecture diagram
sequenceDiagram
participant Eval as Evaluator
participant TS as tracedSpan()
participant OTEL as OTel Tracer
participant Span as OTel Span
participant LS as LangSmith
Note over Eval,LS: NEW: OTel transport branch for tracedSpan
Eval->>TS: tracedSpan(fn, options)
alt EVAL_TRACE_TRANSPORT === "otel"
TS->>TS: resolveTraceTransport() === "otel"
TS->>OTEL: getTracer().startActiveSpan(name, attrs)
OTEL->>Span: Create span with LangSmith attrs
Note over Span: langsmith.span.kind (llm|chain)<br/>input.value + input.mime_type (if input)
Span->>Eval: Return span as SpanLike
Eval->>Span: log(event)
Alt event.output defined
Span->>Span: Set output.value + output.mime_type
end
Alt event.metadata defined
Span->>Span: Set langsmith.metadata
end
alt No exception
Eval->>Span: fn completes
Span->>Span: otelSpan.end()
Span-->>TS: Return result
else Exception thrown
Eval->>Span: error thrown
Span->>Span: recordException(error)
Span->>Span: otelSpan.end()
Span-->>TS: Re-throw error
end
TS-->>Eval: T (result or error)
else EVAL_TRACE_TRANSPORT unset or other
Note over TS: Byte-identical native path (unchanged)
TS->>TS: hasBraintrustApiKey()?
end
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
miguelg719
force-pushed
the
miguelgonzalez/evals-v4-otel-braintrust
branch
from
August 17, 2026 19:46
093bcac to
86312b6
Compare
miguelg719
force-pushed
the
miguelgonzalez/evals-v4-otel-braintrust
branch
from
August 17, 2026 20:03
86312b6 to
d277c74
Compare
miguelg719
force-pushed
the
miguelgonzalez/evals-v4-otel-braintrust
branch
from
August 17, 2026 21:03
d277c74 to
cd314ce
Compare
miguelg719
force-pushed
the
miguelgonzalez/evals-v4-otel-braintrust
branch
from
August 17, 2026 22:05
cd314ce to
6a402a5
Compare
miguelg719
force-pushed
the
miguelgonzalez/evals-v4-otel-braintrust
branch
from
August 17, 2026 22:07
6a402a5 to
ee28d3a
Compare
miguelg719
force-pushed
the
miguelgonzalez/evals-v4-otel-braintrust
branch
from
August 17, 2026 22:34
ee28d3a to
78fdf60
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Stack 4/6.
What
tracedSpanemitting LangSmith attrs (langsmith.span.kind,input/output.value, metadata).traced()/NOOP path below is byte-identical whenEVAL_TRACE_TRANSPORTis unset.Testing
typecheck + unit + build green.
Base: #2759
Summary by cubic
Adds an OTEL branch to tracedSpan in the
braintrustevaluator to emit LangSmith-compatible span attributes when EVAL_TRACE_TRANSPORT=otel. When unset or not "otel", behavior is unchanged; the native traced()/NOOP path remains byte-identical.langsmith.span.kind(llm|chain),input.value/input.mime_type(only when input is present),output.value/output.mime_type(on log), andlangsmith.metadata; values are JSON-serialized and size-capped (mime_typeisapplication/json).EVAL_TRACE_TRANSPORT=otel; no other changes required.Written for commit 78fdf60. Summary will update on new commits.