Skip to content

feat(langchain): Support span streaming#6405

Open
alexander-alderman-webb wants to merge 13 commits into
masterfrom
webb/langchain/span-first
Open

feat(langchain): Support span streaming#6405
alexander-alderman-webb wants to merge 13 commits into
masterfrom
webb/langchain/span-first

Conversation

@alexander-alderman-webb
Copy link
Copy Markdown
Contributor

@alexander-alderman-webb alexander-alderman-webb commented May 26, 2026

Note: Depends on #6407

Description

Use sentry_sdk.traces.start_span and replace Span.set_data() with StreamedSpan.set_attribute() when in span streaming mode.

Also port the patch for Pregel.invoke() used by create_agent() in the LangChain test suite.

Parametrize tests on the trace lifecycle option.

Issues

Closes #6031

Reminders

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 26, 2026

Codecov Results 📊

282 passed | Total: 282 | Pass Rate: 100% | Execution Time: 44.73s

All tests are passing successfully.

❌ Patch coverage is 2.27%. Project has 14841 uncovered lines.

Files with missing lines (2)
File Patch % Lines
langchain.py 3.00% ⚠️ 614 Missing
langgraph.py 5.58% ⚠️ 237 Missing

Generated by Codecov Action

@alexander-alderman-webb alexander-alderman-webb changed the base branch from master to webb/langchain/watched-span May 26, 2026 12:08
@alexander-alderman-webb alexander-alderman-webb marked this pull request as ready for review May 26, 2026 12:23
@alexander-alderman-webb alexander-alderman-webb requested a review from a team as a code owner May 26, 2026 12:23
Comment thread sentry_sdk/integrations/langgraph.py
Comment thread sentry_sdk/integrations/langgraph.py
Base automatically changed from webb/langchain/watched-span to master May 26, 2026 14:21
Comment thread sentry_sdk/integrations/langgraph.py
Comment thread sentry_sdk/integrations/langgraph.py Outdated
Comment thread sentry_sdk/integrations/langgraph.py Outdated
Comment thread sentry_sdk/integrations/langgraph.py Outdated
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 62269f3. Configure here.

Comment thread sentry_sdk/integrations/langgraph.py
Comment thread tests/integrations/langchain/test_langchain.py
Comment thread sentry_sdk/integrations/langchain.py
Sign up for free to 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.

Migrate langchain to span first

1 participant