Skip to content

[bot] LangGraph Platform API client (@langchain/langgraph-sdk) not instrumented — no tracing for cloud agent execution (4,139,284 weekly downloads) #2199

Closed
0 of 2 issues completed

Description

@braintrust-bot

Summary

@langchain/langgraph-sdk is a dedicated HTTP client SDK for the LangGraph Platform (LangGraph Cloud / hosted agent service). It is a completely separate npm package from the @langchain/langgraph local framework and from @langchain/core. As of v1.9.25 it is actively maintained with its own release cadence.

This package is not instrumented today. The existing langchain.ts config only hooks into @langchain/core's CallbackManager (the local framework callback system). Calls made through @langchain/langgraph-sdk bypass that system entirely.

Gap Details

Package: @langchain/langgraph-sdk
Current latest: v1.9.25
Source: https://github.com/langchain-ai/langgraphjs/tree/main/libs/sdk
Zero matches for langgraph-sdk anywhere in js/src/ (confirmed via grep).

Key execution surfaces

Method Description
client.runs.create(threadId, assistantId, options) Start a background run on a thread
client.runs.stream(threadId, assistantId, options) Stream a run's output (returns AsyncGenerator)
client.threads.stream(threadId, options) Stream from a thread checkpoint
client.runs.wait(threadId, runId) Wait for a run to complete and return final output

These are the primary generative-AI execution calls that users make against a deployed LangGraph Platform agent. None are traced.

Why the existing instrumentation does not cover this

The langchain.ts config targets:

// js/src/auto-instrumentations/configs/langchain.ts
module: { name: "@langchain/core", filePath: "dist/callbacks/manager.js" }
functionQuery: { className: "CallbackManager", methodName: "configure" }

@langchain/langgraph-sdk makes direct HTTP requests (via its own BaseClient) to the LangGraph Platform REST API. It does not instantiate @langchain/core models or invoke CallbackManager. The two packages share only a namespace prefix, not a runtime dependency path.

Braintrust Docs Status

The Braintrust LangGraph integration page covers only the local framework (@langchain/langgraph + @langchain/core callbacks). There is no mention of @langchain/langgraph-sdk or LangGraph Platform/Cloud. Users running agents on LangGraph Platform through the SDK will see no spans in Braintrust today.

Suggested Approach

Instrument BaseClient or the specific streaming/run methods in @langchain/langgraph-sdk:

  • Entry file to target: dist/root.cjs or dist/index.cjs (CommonJS) / dist/root.js (ESM) — the file where Client, RunsClient, and ThreadsClient are defined
  • Methods: RunsClient.stream, RunsClient.create, RunsClient.wait, ThreadsClient.stream
  • Channel pattern: consistent with existing naming, e.g. orchestrion:@langchain/langgraph-sdk:runs.stream

Alternatively, a source-replacement patch (similar to the Mastra approach) could wrap the Client constructor to inject tracing.

Weekly downloads: 4,139,284 (as of 2026-10-14; window 2026-10-06 to 2026-10-12; source https://api.npmjs.org/downloads/point/last-week/@langchain/langgraph-sdk)

Activity

  1. changed the title [-][bot] LangGraph Platform API client (@langchain/langgraph-sdk) not instrumented — no tracing for cloud agent execution[/-] [+][bot] LangGraph Platform API client (@langchain/langgraph-sdk) not instrumented — no tracing for cloud agent execution (3,372,359 weekly downloads)[/+] on Jul 30, 2026
  2. github-actions commented on Aug 30, 2026

    @github-actions
    Contributor

    This issue has been automatically marked as stale because it has not had recent activity. If this issue is still relevant, please leave a comment or remove the stale label. Thank you for your contributions!

  3. changed the title [-][bot] LangGraph Platform API client (@langchain/langgraph-sdk) not instrumented — no tracing for cloud agent execution (3,372,359 weekly downloads)[/-] [+][bot] LangGraph Platform API client (@langchain/langgraph-sdk) not instrumented — no tracing for cloud agent execution (3,279,492 weekly downloads)[/+] on Sep 7, 2026
  4. github-actions commented on Sep 15, 2026

    @github-actions
    Contributor

    A release containing the fix/implementation for this issue has been published:

    Included via #2441.

  5. changed the title [-][bot] LangGraph Platform API client (@langchain/langgraph-sdk) not instrumented — no tracing for cloud agent execution (3,279,492 weekly downloads)[/-] [+][bot] LangGraph Platform API client (@langchain/langgraph-sdk) not instrumented — no tracing for cloud agent execution (4,139,284 weekly downloads)[/+] on Oct 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions