Commit b2fd97e
feat(langchain): Update LLM span operation to gen_ai.generate_text (#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 #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
File tree
2 files changed
+8
-7
lines changed- sentry_sdk/integrations
- tests/integrations/langchain
2 files changed
+8
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
351 | 351 | | |
352 | 352 | | |
353 | 353 | | |
354 | | - | |
355 | 354 | | |
356 | 355 | | |
357 | 356 | | |
| |||
369 | 368 | | |
370 | 369 | | |
371 | 370 | | |
372 | | - | |
373 | | - | |
| 371 | + | |
| 372 | + | |
374 | 373 | | |
375 | 374 | | |
376 | 375 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
851 | 851 | | |
852 | 852 | | |
853 | 853 | | |
854 | | - | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
855 | 857 | | |
856 | 858 | | |
857 | 859 | | |
858 | 860 | | |
859 | | - | |
| 861 | + | |
860 | 862 | | |
861 | 863 | | |
862 | 864 | | |
| |||
1062 | 1064 | | |
1063 | 1065 | | |
1064 | 1066 | | |
1065 | | - | |
| 1067 | + | |
1066 | 1068 | | |
1067 | 1069 | | |
1068 | 1070 | | |
| |||
1776 | 1778 | | |
1777 | 1779 | | |
1778 | 1780 | | |
1779 | | - | |
| 1781 | + | |
1780 | 1782 | | |
1781 | 1783 | | |
1782 | 1784 | | |
| |||
0 commit comments