Skip to content

evals(v4): OTEL/LangSmith + braintrust 3.x deps - #2757

Open
miguelg719 wants to merge 1 commit into
mainfrom
miguelgonzalez/evals-v4-otel-deps
Open

evals(v4): OTEL/LangSmith + braintrust 3.x deps#2757
miguelg719 wants to merge 1 commit into
mainfrom
miguelgonzalez/evals-v4-otel-deps

Conversation

@miguelg719

@miguelg719 miguelg719 commented Aug 17, 2026

Copy link
Copy Markdown
Collaborator

Why

Retargets the LangSmith/OTEL eval-tracing work onto Stagehand 4.0. Stack 1/6 (deps).

What

  • Add langsmith, @opentelemetry/{api,sdk-trace-base,sdk-trace-node,exporter-trace-otlp-proto}, @braintrust/otel; bump braintrust 0.4→3.x.
  • @opentelemetry/api pinned catalog: (1.9.1) to share the SDK's global tracer.
  • Fix braintrust-3.x wrapAISDK return-type in AISdkClientWrapped via Pick<typeof ai, …>.

Testing

typecheck + unit + build green.

Base: main


Summary by cubic

Adds OpenTelemetry and LangSmith tracing dependencies and upgrades braintrust to 3.x to prepare evals v4 for distributed tracing. No runtime behavior change; only dependency and type updates.

  • Adds langsmith, @opentelemetry/{api,sdk-trace-base,sdk-trace-node,exporter-trace-otlp-proto}, @braintrust/otel; moves braintrust to runtime deps at ^3.21.0.
  • Pins @opentelemetry/api via catalog: to share a single global tracer across the workspace.
  • Disables native braintrust postinstall via workspace allowBuilds.braintrust: false.
  • Fixes AISdkClientWrapped types for braintrust 3.x by deriving WrappedAI from ai and casting wrapAISDK(ai); public surface unchanged.
  • Lockfile churn only. Migration: none — run pnpm install.

Written for commit 53a0364. Summary will update on new commits.

Review in cubic

@changeset-bot

changeset-bot Bot commented Aug 17, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 53a0364

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@socket-security

socket-security Bot commented Aug 17, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addednpm/​braintrust@​3.27.0931001009780
Addednpm/​langsmith@​0.5.26988510099100
Addednpm/​@​braintrust/​otel@​0.2.19210010088100
Addednpm/​@​opentelemetry/​sdk-trace-node@​2.10.010010010094100
Addednpm/​@​opentelemetry/​exporter-trace-otlp-proto@​0.220.09910010096100

View full report

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 3 files

Architecture diagram
sequenceDiagram
    participant E as Eval Runner
    participant AI as AI SDK (ai module)
    participant BT as Braintrust SDK
    participant OTEL as OpenTelemetry SDK
    participant LS as LangSmith
    participant EXP as OTLP Exporter
    participant API as External Tracing API

    Note over E,API: Eval Tracing Infrastructure (v4)

    E->>AI: import { generateText, generateObject, streamText, streamObject }
    E->>AI: initialize AI SDK
    
    Note over E,BT: Wrapped AI SDK layer
    E->>BT: wrapAISDK(ai)
    BT->>BT: Create wrapped AISDK client
    BT-->>E: Wrapped client (typed via Pick)
    E->>AI: Call wrapped generateText/generateObject/streamText/streamObject

    Note over BT,OTEL: Braintrust OTEL integration
    BT->>OTEL: Get global tracer (catalog: 1.9.1)
    OTEL-->>BT: Shared tracer instance
    BT->>OTEL: Create spans for AI operations
    OTEL->>EXP: Export trace data via OTLP proto
    EXP->>API: Send spans to configured collector

    Note over BT,LS: LangSmith integration
    BT->>LS: Initialize LangSmith client
    LS->>LS: Configure trace processor
    BT->>LS: Send trace data
    LS->>API: Export to LangSmith backend

    alt Trace export success
        API-->>OTEL: Ack received
        API-->>LS: Ack received
    else Export failure
        API-->>OTEL: Error
        API-->>LS: Error
        Note over OTEL,LS: Failures non-blocking, eval continues
    end

    E->>E: Process eval results
    E-->>E: Return results (unchanged surface)
Loading

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread packages/evals/package.json Outdated
@miguelg719
miguelg719 force-pushed the miguelgonzalez/evals-v4-otel-deps branch 5 times, most recently from a1737fd to f58c04f Compare August 17, 2026 22:07
@miguelg719
miguelg719 force-pushed the miguelgonzalez/evals-v4-otel-deps branch from f58c04f to 53a0364 Compare August 17, 2026 22:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant