Skip to content

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

Description

@RulaKhaled

Follow-up to #23582. langchain.chain.name is a JS-only attribute with no entry in the conventions registry, while gen_ai.pipeline.name — "Name of the AI pipeline or chain being executed" — covers exactly this value and is already set by our LangGraph instrumentation (packages/server-utils/src/ai/langgraph/index.ts:115). LangChain is the odd one out.

Conventions

  • Register langchain.chain.name as deprecated, with gen_ai.pipeline.name as its replacement
  • Add {{gen_ai.operation.name}} {{gen_ai.pipeline.name}} to the gen_ai agent name templates, so invoke_agent format_prompt is template-backed

SDK

  • Emit gen_ai.pipeline.name instead of langchain.chain.name on LangChain chain spans (packages/server-utils/src/ai/langchain/index.ts, handleChainStart)
  • Skip the attribute entirely when the chain is unnamed, rather than writing the unknown_chain sentinel into a registered attribute — matches LangGraph, which only sets pipeline.name when a graph name exists
  • Update unit + integration tests that assert langchain.chain.name
  • Add a MIGRATION.md bullet under the existing gen_ai attribute renames in the v11 section

Notes

  • Breaking change: the attribute ships in v10, so dashboards/alerts/ignoreSpans rules keyed on langchain.chain.name will silently stop matching. Needs to land before v11 releases so it rides along with the renames already listed there.
  • Span names are unaffected. feat(server-utils): Emit low-cardinality gen_ai agent span names when streaming #23582 builds invoke_agent {chainName} from a local variable, not from the attribute, so the rename doesn't change any name.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions