Title: fix(node): Prevent duplicate LangChain spans from double module patching · Issue #19685 · getsentry/sentry-javascript · GitHub
Open Graph Title: fix(node): Prevent duplicate LangChain spans from double module patching · Issue #19685 · getsentry/sentry-javascript
X Title: fix(node): Prevent duplicate LangChain spans from double module patching · Issue #19685 · getsentry/sentry-javascript
Description: NoteThe pull request "fix(node): Prevent duplicate LangChain spans from double module patching " was created by @nicohrubec but did not reference an issue. Therefore this issue was created for better visibility in external tools like Lin...
Open Graph Description: NoteThe pull request "fix(node): Prevent duplicate LangChain spans from double module patching " was created by @nicohrubec but did not reference an issue. Therefore this issue was created for bett...
X Description: NoteThe pull request "fix(node): Prevent duplicate LangChain spans from double module patching " was created by @nicohrubec but did not reference an issue. Therefore this issue was create...
Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/19685
X: @github
Domain: github.com
IPv4 address: 140.82.112.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"fix(node): Prevent duplicate LangChain spans from double module patching ","articleBody":"> [!NOTE]\n> The pull request \"[fix(node): Prevent duplicate LangChain spans from double module patching ](https://github.com/getsentry/sentry-javascript/pull/19684)\" was created by @nicohrubec but did not reference an issue. Therefore this issue was created for better visibility in external tools like Linear.\n\nThe LangChain instrumentation registers both a module-level and a file-level hook for each provider package (e.g. `@langchain/openai`). Both hooks call _patch, which wraps the same prototype methods (invoke, stream, batch) with a new \r\n proxy and callback handler. This results in every LangChain call producing duplicate gen_ai.chat spans. The fix adds a `__sentry_patched__` guard on the prototype to skip patching if it's already been done.\r\n\n","author":{"url":"https://github.com/apps/github-actions","@type":"Person","name":"github-actions"},"datePublished":"2026-03-06T14:31:54Z","url":"https://github.com/getsentry/sentry-javascript/issues/19685"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:06857457-effb-600f-797f-f74590669ec5 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | EB78:3FAE88:252DFA:32EE22:6B04B762 |
| html-safe-nonce | 19a6bc2340a60de9170c835c07795247df73b333ace2bbc13de7dbdc8e61c49b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQjc4OjNGQUU4ODoyNTJERkE6MzJFRTIyOjZCMDRCNzYyIiwidmlzaXRvcl9pZCI6IjE2MjcxOTA1ODU3MDg1NTgxNzgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | fec98854498b5d8ce253a8c1066a0cdb7314071624786b7362713f938cdee2db |
| hovercard-subject-tag | issue:4034528943 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/getsentry/sentry-javascript/19685/issue_layout |
| twitter:image | https://opengraph.githubassets.com/ffbe3ddaf2fa71f5dc001eddab80f85e2c3ea48aae27869576b47b6b326c5b8a/getsentry/sentry-javascript/issues/19685 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/ffbe3ddaf2fa71f5dc001eddab80f85e2c3ea48aae27869576b47b6b326c5b8a/getsentry/sentry-javascript/issues/19685 |
| og:image:alt | NoteThe pull request "fix(node): Prevent duplicate LangChain spans from double module patching " was created by @nicohrubec but did not reference an issue. Therefore this issue was created for bett... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | github-actions[bot] |
| hostname | github.com |
| expected-hostname | github.com |
| None | 378bd702ac792b3550e484ad39d9a898fcd25bb52ba6962b0c9cc457c1ea71c7 |
| turbo-cache-control | no-preview |
| go-import | github.com/getsentry/sentry-javascript git https://github.com/getsentry/sentry-javascript.git |
| octolytics-dimension-user_id | 1396951 |
| octolytics-dimension-user_login | getsentry |
| octolytics-dimension-repository_id | 3328572 |
| octolytics-dimension-repository_nwo | getsentry/sentry-javascript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 3328572 |
| octolytics-dimension-repository_network_root_nwo | getsentry/sentry-javascript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | b032e77f1ea437ede6c115446a0a467709b468e7 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width