Skip to content

feat(bedrock): Set token attributes for streamed responses - #8235

Merged
alexander-alderman-webb merged 11 commits into
masterfrom
webb/bedrock/token-attributes
Nov 10, 2026
Merged

alexander-alderman-webb merged 11 commits into
masterfrom
webb/bedrock/token-attributes

Conversation

@alexander-alderman-webb

@alexander-alderman-webb alexander-alderman-webb commented Nov 10, 2026 •

Copy link
Copy Markdown
Collaborator

Change the extension interface to require on_success_response() instead of get_response_attributes().
This is required so that the Bedrock extension closes the span when the streamed model response is completed or is unexpectedly suspended.

Handle iterators for streaming responses analogously to other GenAI integrations, and add a test with an error bubbling up during stream iteration.
The current pattern is setting the span status to error if anything other than a GeneratorExit bubbles through the iteration.

@alexander-alderman-webb
alexander-alderman-webb force-pushed the webb/bedrock/token-attributes branch from 74d8ae4 to 672b917 Compare November 10, 2026 11:34
@alexander-alderman-webb
alexander-alderman-webb marked this pull request as ready for review November 10, 2026 11:36
@alexander-alderman-webb
alexander-alderman-webb requested a review from a team as a code owner November 10, 2026 11:36

@cursor cursor Bot 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.

Stale Bugbot comment from a previous run.

@alexander-alderman-webb
alexander-alderman-webb marked this pull request as draft November 10, 2026 11:45
@github-actions

github-actions Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Coverage Results 📊

✅ 137444 passed | ⏭️ 7671 skipped | Total: 145115 | Pass Rate: 94.71% | Execution Time: 435m 15s

📊 Comparison with Base Branch

Metric Change
Total Tests —
Passed Tests —
Failed Tests —
Skipped Tests —

✨ Test counts unchanged from base.

All tests are passing successfully.

✅ Patch coverage is 80.19% (85 of 106 changed executable lines covered; target 80%).
Project statement coverage is 90.24% (down 0.07 percentage points from base (f110be5) to head (356182c)).

Changed files with executable lines (4)
File Patch coverage Changed executable lines
sentry_sdk/integrations/boto3/_services/bedrock.py 79.80% 79/99 covered; missed: 20, 21, 48, 78, 79, 119, 132, 133, 135, 136, 137, 138, 139, 140, 141, 143, 299, 300, 301, 303; partial branches: 47, 77, 294
sentry_sdk/integrations/boto3/_services/base.py 50.00% 1/2 covered; missed: 42
sentry_sdk/integrations/boto3/init.py 100.00% 2/2 covered
sentry_sdk/integrations/boto3/_client.py 100.00% 3/3 covered
Coverage diff
@@            Coverage Diff             @@
##        master     #8235       +/-##
==========================================
- Coverage    90.31%    90.24%    -0.07%
==========================================
  Files          203       203         —
  Tracked lines     27020     27114       +94
  Branches     10106     10136       +30
==========================================
+ Hits         24404     24469       +65
- Misses        2616      2645       +29
- Partials      1534      1539        +5

Generated by Coverage Action

@alexander-alderman-webb
alexander-alderman-webb force-pushed the webb/bedrock/token-attributes branch 2 times, most recently from c77498f to d920520 Compare November 10, 2026 13:55
@alexander-alderman-webb
alexander-alderman-webb force-pushed the webb/bedrock/token-attributes branch from d920520 to ce4225d Compare November 10, 2026 13:56
@alexander-alderman-webb
alexander-alderman-webb marked this pull request as ready for review November 10, 2026 13:58

@cursor cursor Bot 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.

Stale Bugbot comment from a previous run.

Base automatically changed from webb/bedrock/response-model to master November 10, 2026 15:31

@cursor cursor Bot 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.

Stale Bugbot comment from a previous run.

@alexander-alderman-webb
alexander-alderman-webb force-pushed the webb/bedrock/token-attributes branch 2 times, most recently from 78e7752 to 4335059 Compare November 10, 2026 15:54
@alexander-alderman-webb
alexander-alderman-webb enabled auto-merge (squash) November 10, 2026 15:56

@cursor cursor Bot 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 4335059. Configure here.

@alexander-alderman-webb
alexander-alderman-webb force-pushed the webb/bedrock/token-attributes branch 2 times, most recently from 7eed4f8 to fbfe80f Compare November 10, 2026 16:03
@alexander-alderman-webb
alexander-alderman-webb force-pushed the webb/bedrock/token-attributes branch from fbfe80f to 356182c Compare November 10, 2026 16:04
@alexander-alderman-webb
alexander-alderman-webb merged commit 843958d into master Nov 10, 2026
167 checks passed
@alexander-alderman-webb
alexander-alderman-webb deleted the webb/bedrock/token-attributes branch November 10, 2026 16:17
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.

2 participants