feat(langchain): Update LLM span operation to gen_ai.generate_text (#… · gitcommit90/sentry-python@b2fd97e · GitHub
Skip to content

Commit b2fd97e

Browse files
ericapisaniclaude
andauthored
feat(langchain): Update LLM span operation to gen_ai.generate_text (getsentry#5796)
Update LangChain integration to use the new `gen_ai.generate_text` operation for LLM call spans, aligning with OpenTelemetry semantic conventions. **Changes:** - Changed LLM span operation from `gen_ai.pipeline` to `gen_ai.generate_text` - Updated span naming to include the model identifier: `generate_text {model}` instead of generic "Langchain LLM call" - Removed unnecessary docstring from callback method - Updated test assertions to validate the new operation and naming convention 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 getsentry#5705 (this is being broken down into 2 parts due to upcoming changes in the langchain test suite) Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com>
1 parent 4cd6752 commit b2fd97e

2 files changed

Lines changed: 8 additions & 7 deletions

File tree

sentry_sdk/integrations/langchain.py

Lines changed: 2 additions & 3 deletions

tests/integrations/langchain/test_langchain.py

Lines changed: 6 additions & 4 deletions

0 commit comments

Comments
 (0)