feat(langchain): Update LLM span operation to gen_ai.generate_text#5796
Merged
ericapisani merged 1 commit intomasterfrom Mar 24, 2026
Merged
feat(langchain): Update LLM span operation to gen_ai.generate_text#5796ericapisani merged 1 commit intomasterfrom
ericapisani merged 1 commit intomasterfrom
Conversation
Change LLM span operation type from gen_ai.pipeline to gen_ai.generate_text
and update span naming to include the model identifier.
- Use gen_ai.generate_text operation for LLM calls
- Set span name to 'generate_text {model}' instead of generic 'Langchain LLM call'
- Update test assertions to match new span operation and description
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Contributor
Semver Impact of This PR🟡 Minor (new features) 📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨
Bug Fixes 🐛Anthropic
Other
Documentation 📚
Internal Changes 🔧
Other
🤖 This preview updates automatically when you update the PR. |
alexander-alderman-webb
approved these changes
Mar 24, 2026
Contributor
Codecov Results 📊✅ 13 passed | Total: 13 | Pass Rate: 100% | Execution Time: 7.04s All tests are passing successfully. ✅ Patch coverage is 100.00%. Project has 14381 uncovered lines. Files with missing lines (1)
Generated by Codecov Action |
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.
Update LangChain integration to use the new
gen_ai.generate_textoperation for LLM call spans, aligning with OpenTelemetry semantic conventions.Changes:
gen_ai.pipelinetogen_ai.generate_textgenerate_text {model}instead of generic "Langchain LLM call"This change improves observability by using more specific operation types that accurately reflect the semantic nature of LLM generation calls, and includes the model identifier for better span context.
Related to SDK-669. Replaces some of the changes introduced in #5705 (this is being broken down into 2 parts due to upcoming changes in the langchain test suite)