feat(core): Instrument langgraph createReactAgent#18403
feat(core): Instrument langgraph createReactAgent#18403nicohrubec wants to merge 37 commits intodevelopfrom
Conversation
size-limit report 📦
|
node-overhead report 🧳Note: This is a synthetic benchmark with a minimal express app and does not necessarily reflect the real-world performance impact in an application.
|
This reverts commit 481fc12.
This patches the `@langchain/langgraph/prebuilt` submodule export, when loading in ESM mode. Requires an update to `@opentelemetry/instrumentation`, in order to not block the patching of ESM submodule exports. depends-on: open-telemetry/opentelemetry-js#6246
Codecov Results 📊Generated by Codecov Action |
6ff8d6d to
df9c9d2
Compare
|
@RulaKhaled This should finally work now, not sure about bundle size increase but this is probably a result of the opentelemetry bumps |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| handled: false, | ||
| type: 'auto.ai.langgraph.error', | ||
| }, | ||
| }); |
There was a problem hiding this comment.
Mechanism type doesn't align with span origin
Low Severity
In the new instrumentCreateReactAgent function, the mechanism.type is set to 'auto.ai.langgraph.error', which doesn't align with the SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN value of 'auto.ai.langgraph'. Other AI integrations (Anthropic uses 'auto.ai.anthropic', Google GenAI uses 'auto.ai.google_genai') set the mechanism type to match the origin exactly. The .error suffix deviates from that convention. This also applies to the pre-existing instances at lines 77 and 177, but since this is new code, it's a good opportunity to align with the convention.
Triggered by project rule: PR Review Guidelines for Cursor Bot


This PR instruments langgraph
createReactAgent. This is only relevant for pre v1 langgraph. Starting from v >1.0.0createReactAgentis replaced withcreate_agent, which is exported fromlangchain. The model is now also extracted and send along in the span. Getting this to run required some changes to opentelemetry and IITM to allow for instrumentation of submodule exports (that's why there are a bunch of version bumps in here as well).Closes #19372 (added automatically)