fix(langgraph): Call instrumentLangGraph before .compile()#16611
Open
priscilawebdev wants to merge 3 commits intomasterfrom
Open
fix(langgraph): Call instrumentLangGraph before .compile()#16611priscilawebdev wants to merge 3 commits intomasterfrom
priscilawebdev wants to merge 3 commits intomasterfrom
Conversation
instrumentLangGraph works by wrapping the .compile() method on a StateGraph to intercept the compilation step and inject tracing. It must be called before .compile() is invoked. The previous example called instrumentLangGraph on the already-compiled graph — by that point the compile step has already happened, so there is no hook point for the SDK to instrument. Also update the surrounding description to reflect that the helper wraps a StateGraph before compilation, not a compiled graph. Co-Authored-By: Claude <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
docs/platforms/javascript/common/configuration/integrations/langgraph.mdx
Show resolved
Hide resolved
The alert box incorrectly said "wrap your compiled graph", implying instrumentLangGraph should be called post-compilation. It must be called on the StateGraph before .compile(), as stated elsewhere in the doc and shown in the code examples. Co-Authored-By: Claude <noreply@anthropic.com>
docs/platforms/javascript/common/configuration/integrations/langgraph.mdx
Show resolved
Hide resolved
Co-Authored-By: Claude <noreply@anthropic.com>
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.
DESCRIBE YOUR PR
Fix the
instrumentLangGraphexample in the Browser-Side Usage section to call the helper before.compile(), not after.instrumentLangGraphworks by wrapping the.compile()method on aStateGraphto intercept the compilation step and inject tracing. It must be called before.compile()is invoked. The previous example passed the already-compiled graph, meaning the compile step had already happened and there was no hook point for the SDK to instrument.Also updates the surrounding description from "wrapping a compiled LangGraph graph" to "wrapping a StateGraph before compilation" to match the correct usage.
Related fix in the sentry repo: getsentry/sentry#109551
IS YOUR CHANGE URGENT?
SLA
Thanks in advance for your help!
PRE-MERGE CHECKLIST
Co-Authored-By: Claude noreply@anthropic.com