Skip to content

feat(anthropic): Support span streaming#6311

Merged
alexander-alderman-webb merged 14 commits into
masterfrom
webb/anthropic/span-first
May 22, 2026
Merged

feat(anthropic): Support span streaming#6311
alexander-alderman-webb merged 14 commits into
masterfrom
webb/anthropic/span-first

Conversation

@alexander-alderman-webb
Copy link
Copy Markdown
Contributor

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

Note: Depends on #6312

Description

Remove undocumented unknown_response attribute.

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

Parametrize tests on the trace lifecycle option.

Issues

Closes #5997

Reminders

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 21, 2026

Codecov Results 📊

5 passed | Total: 5 | Pass Rate: 100% | Execution Time: 898ms

📊 Comparison with Base Branch

Metric Change
Total Tests 📉 -2
Passed Tests 📉 -2
Failed Tests
Skipped Tests

All tests are passing successfully.

❌ Patch coverage is 7.69%. Project has 17382 uncovered lines.
❌ Project coverage is 22.93%. Comparing base (base) to head (head).

Files with missing lines (2)
File Patch % Lines
tracing_utils.py 30.39% ⚠️ 529 Missing and 39 partials
anthropic.py 5.83% ⚠️ 436 Missing
Coverage diff
@@            Coverage Diff             @@
##          main       #PR       +/-##
==========================================
- Coverage    23.15%    22.93%    -0.22%
==========================================
  Files          190       190         —
  Lines        22531     22554       +23
  Branches      7676      7692       +16
==========================================
+ Hits          5215      5172       -43
- Misses       17316     17382       +66
- Partials       479       476        -3

Generated by Codecov Action

@alexander-alderman-webb alexander-alderman-webb marked this pull request as ready for review May 21, 2026 07:14
@alexander-alderman-webb alexander-alderman-webb requested a review from a team as a code owner May 21, 2026 07:14
Comment thread sentry_sdk/tracing_utils.py Outdated
Comment thread tests/integrations/anthropic/test_anthropic.py Outdated
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.

👍🏻 Small improvement suggestions in comments

Comment thread sentry_sdk/integrations/anthropic.py Outdated
Comment thread sentry_sdk/integrations/anthropic.py Outdated
Comment thread sentry_sdk/integrations/anthropic.py Outdated
Comment thread sentry_sdk/integrations/anthropic.py Outdated
@sentrivana
Copy link
Copy Markdown
Contributor

One more thing: I didn't double check if all the attributes exist in conventions, but I assume you've done that already.

Comment thread sentry_sdk/integrations/anthropic.py
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 53bf159. Configure here.

Comment thread sentry_sdk/integrations/anthropic.py
@alexander-alderman-webb alexander-alderman-webb merged commit 0788e52 into master May 22, 2026
154 of 157 checks passed
@alexander-alderman-webb alexander-alderman-webb deleted the webb/anthropic/span-first branch May 22, 2026 12:13
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 anthropic to span first

2 participants