Skip to content

feat(langchain): Support span streaming#6405

Merged
alexander-alderman-webb merged 13 commits into
masterfrom
webb/langchain/span-first
May 27, 2026
Merged

feat(langchain): Support span streaming#6405
alexander-alderman-webb merged 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 📊

13 passed | Total: 13 | Pass Rate: 100% | Execution Time: 4.38s

📊 Comparison with Base Branch

Metric Change
Total Tests
Passed Tests
Failed Tests
Skipped Tests

✨ No test changes detected

All tests are passing successfully.

❌ Patch coverage is 2.27%. Project has 16470 uncovered lines.
❌ Project coverage is 27.65%. Comparing base (base) to head (head).

Files with missing lines (2)
File Patch % Lines
langchain.py 3.00% ⚠️ 614 Missing
langgraph.py 5.58% ⚠️ 237 Missing
Coverage diff
@@            Coverage Diff             @@
##          main       #PR       +/-##
==========================================
- Coverage    30.67%    27.65%    -3.02%
==========================================
  Files          190       190         —
  Lines        22689     22764       +75
  Branches      7742      7778       +36
==========================================
+ Hits          6958      6294      -664
- Misses       15731     16470      +739
- Partials       584       572       -12

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
Copy link
Copy Markdown
Contributor

@sentrivana sentrivana left a comment

Choose a reason for hiding this comment

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

lgtm!

We need to get rid of the custom span_map business at some point 😭

@alexander-alderman-webb alexander-alderman-webb merged commit 0e237dd into master May 27, 2026
164 of 168 checks passed
@alexander-alderman-webb alexander-alderman-webb deleted the webb/langchain/span-first branch May 27, 2026 11:31
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

2 participants