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

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

Copy link
Copy Markdown
Contributor

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

github-actionsBot commented May 21, 2026

Copy link
Copy Markdown
Contributor

Codecov Results 📊

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

📊 Comparison with Base Branch

MetricChange
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)
FilePatch %Lines
tracing_utils.py30.39%⚠️ 529 Missing and 39 partials
anthropic.py5.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 ownerMay 21, 2026 07:14
Comment threadsentry_sdk/tracing_utils.py Outdated
Comment threadtests/integrations/anthropic/test_anthropic.py Outdated

@sentrivanasentrivana left a comment

Copy link
Copy Markdown
Contributor

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 threadsentry_sdk/integrations/anthropic.py Outdated
Comment threadsentry_sdk/integrations/anthropic.py Outdated
Comment threadsentry_sdk/integrations/anthropic.py Outdated
Comment threadsentry_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 threadsentry_sdk/integrations/anthropic.py

@cursorcursorBot left a comment

Copy link
Copy Markdown

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 threadsentry_sdk/integrations/anthropic.py
@alexander-alderman-webb
alexander-alderman-webb merged commit 0788e52 into masterMay 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
mgaligniana pushed a commit to mgaligniana/sentry-python that referenced this pull request Aug 9, 2026
Drop the `unknown_response` attribute in streaming lifecycle mode.
Sign up for freeto 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

@alexander-alderman-webb@sentrivana