Skip to content

feat(langchain): Emit gen_ai.pipeline.name instead of langchain.chain.name - #23740

Merged
RulaKhaled merged 3 commits into
developfrom
rolaabuhasna/js-3452-move-langchainchainname-to-gen_aipipelinename
Aug 31, 2026
Merged

feat(langchain): Emit gen_ai.pipeline.name instead of langchain.chain.name#23740
RulaKhaled merged 3 commits into
developfrom
rolaabuhasna/js-3452-move-langchainchainname-to-gen_aipipelinename

Conversation

@RulaKhaled

@RulaKhaledRulaKhaled commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator

LangChain chain spans now emit gen_ai.pipeline.name instead of the js only langchain.chain.name, matching LangGraph so dashboards, alerts, and span-name templates share one key. Unnamed chains omit the attribute rather than writing unknown_chain; span names are unchanged.

Fixes#23683

…n.name
LangChain was the odd one out — LangGraph already sets the conventions
attribute, while langchain.chain.name was a JS-only key. Unnamed chains
skip the attribute rather than writing unknown_chain into a registered key.
Fixes#23683
Co-Authored-By: Cursor Grok 4.6 <cursoragent@cursor.com>
@linear-code

Copy link
Copy Markdown

JS-3452

@github-actions

github-actionsBot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

PathSize% ChangeChange
@sentry/browser28.56 kB--
@sentry/browser - with treeshaking flags26.92 kB--
@sentry/browser - with treeshaking flags tracing without tracing26.82 kB--
@sentry/browser (incl. Tracing)48.75 kB--
@sentry/browser (incl. Tracing + Span Streaming)48.76 kB--
@sentry/browser (incl. Tracing, Profiling)51.68 kB--
@sentry/browser (incl. Tracing, Replay)88.23 kB--
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags77.63 kB--
@sentry/browser (incl. Tracing, Replay with Canvas)92.93 kB--
@sentry/browser (incl. Tracing, Replay, Feedback)105.85 kB--
@sentry/browser (incl. Feedback)46.05 kB--
@sentry/browser (incl. sendFeedback)33.62 kB--
@sentry/browser (incl. FeedbackAsync)38.73 kB--
@sentry/browser (incl. Metrics)29.51 kB--
@sentry/browser (incl. Logs)29.8 kB--
@sentry/browser (incl. Metrics & Logs)30.43 kB--
@sentry/react30.3 kB--
@sentry/react (incl. Tracing)50.94 kB--
@sentry/vue35.73 kB--
@sentry/vue (incl. Tracing)51.02 kB--
@sentry/svelte28.59 kB--
CDN Bundle30.35 kB--
CDN Bundle (incl. Tracing)49.38 kB--
CDN Bundle (incl. Logs, Metrics)32.58 kB--
CDN Bundle (incl. Tracing, Logs, Metrics)51.25 kB--
CDN Bundle (incl. Replay, Logs, Metrics)73.17 kB--
CDN Bundle (incl. Tracing, Replay)86.86 kB--
CDN Bundle (incl. Tracing, Replay, Logs, Metrics)88.73 kB--
CDN Bundle (incl. Tracing, Replay, Feedback)92.8 kB--
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics)94.64 kB--
CDN Bundle - uncompressed89.95 kB--
CDN Bundle (incl. Tracing) - uncompressed147.2 kB--
CDN Bundle (incl. Logs, Metrics) - uncompressed96.24 kB--
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed152.89 kB--
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed225.41 kB--
CDN Bundle (incl. Tracing, Replay) - uncompressed266.69 kB--
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed272.37 kB--
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed280.4 kB--
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed286.06 kB--
@sentry/nextjs (client)53.56 kB--
@sentry/sveltekit (client)49.19 kB--
@sentry/core/server65.7 kB--
@sentry/core/browser51.86 kB--
@sentry/node123.77 kB+0.02%+23 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection)85.53 kB--
@sentry/node - without tracing88.03 kB+0.02%+16 B 🔺
@sentry/node - without channel injection103.18 kB+0.02%+18 B 🔺
@sentry/aws-serverless96.42 kB+0.03%+27 B 🔺
@sentry/cloudflare (withSentry) - minified201.04 kB--
@sentry/cloudflare (withSentry)500.26 kB--

View base workflow run

@RulaKhaled
RulaKhaled marked this pull request as ready for review August 28, 2026 14:37
@RulaKhaled
RulaKhaled requested review from a team as code ownersAugust 28, 2026 14:37
@RulaKhaled
RulaKhaled requested review from Lms24, andreiborza and isaacs and removed request for a teamAugust 28, 2026 14:37
Comment threadpackages/server-utils/src/ai/langchain/index.ts
: chainName
? `invoke_agent ${chainName}`
: 'invoke_agent',
op: 'gen_ai.invoke_agent',

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

m: We don't want to set op anymore directly, I think. Right @Lms24?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

yes, let's remove it as we already set the sentry.op attribute :)

Comment threadpackages/server-utils/src/ai/langchain/index.ts Outdated
@Lms24

Copy link
Copy Markdown
Member

super-l: We can remove the ! from the commit message. not an API-breaking change

@RulaKhaledRulaKhaled changed the title feat(langchain)!: Emit gen_ai.pipeline.name instead of langchain.chain.namefeat(langchain): Emit gen_ai.pipeline.name instead of langchain.chain.nameAug 31, 2026
@RulaKhaled
RulaKhaled merged commit 2d9e39b into developAug 31, 2026
280 of 285 checks passed
@RulaKhaled
RulaKhaled deleted the rolaabuhasna/js-3452-move-langchainchainname-to-gen_aipipelinename branch August 31, 2026 21:16
Sign up for freeto 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.

Move langchain.chain.name to gen_ai.pipeline.name

3 participants

@RulaKhaled@Lms24@andreiborza