Repository navigation
feat(bedrock): Add extension skeleton - #8226
alexander-alderman-webb wants to merge 1 commit into
Conversation
819486b to
3fc87ab
Compare
| (span,) = (item.payload for item in items if item.type == "span") | ||
|
|
||
| assert span["attributes"][SPANDATA.GEN_AI_PROVIDER_NAME] == "aws.bedrock" | ||
| assert span["attributes"][SPANDATA.GEN_AI_RESPONSE_STREAMING] is False |
There was a problem hiding this comment.
Bedrock tests assume streaming span payloads in static mode
All four tests run with span_streaming=False, but still search for standalone type == "span" items and read span attributes from span["attributes"]. Static mode stores child spans in the transaction payload under spans and their attributes under data, so those cases fail. The error tests also need to accept the static span status internal_error in addition to error.
Evidence
- Each Bedrock test parametrizes
span_streamingasTrueandFalse, but always selects a standalonespanitem and readsattributes. _capture_boto3_spans_by_opintest_client.pyhandles static mode by readingtransaction["spans"];_span_attributesreads static attributes fromdata._finish_spansets static spans with an exception tointernal_error, while the Bedrock error tests assert onlyerror.
Identified by Warden · code-review · RSS-AQT
There was a problem hiding this comment.
right this magic works because of stream_gen_ai_spans.
I'll create equivalent tests for when the option is disabled.
There was a problem hiding this comment.
Fix attempt detected (commit d6cde74)
The tests explicitly parameterize static mode, but still read standalone span attributes and assert only the streaming-mode error status, so the reported failures remain.
The original issue appears unresolved. Please review and try again.
Evaluated by Warden
Coverage Results 📊✅ 136504 passed | ❌ 1 failed | ⏭️ 7521 skipped | Total: 144026 | Pass Rate: 94.78% | Execution Time: 444m 54s 📊 Comparison with Base Branch
➕ New Tests (1)View new tests
❌ Failed Tests
|
| File | Patch coverage | Changed executable lines |
|---|---|---|
| sentry_sdk/integrations/boto3/_services/bedrock.py | 85.00% | 17/20 covered; missed: 19, 24, 29; partial branches: 18, 23, 28 |
| sentry_sdk/integrations/boto3/_instrumentation.py | 100.00% | 9/9 covered; partial branches: 185, 189, 195 |
| sentry_sdk/integrations/boto3/_client.py | 100.00% | 4/4 covered |
| sentry_sdk/integrations/boto3/_services/base.py | 100.00% | 1/1 covered |
Coverage diff
@@ Coverage Diff @@
## master #8226 +/-##
==========================================
- Coverage 90.30% 90.28% -0.02%
==========================================
Files 203 203 —
Tracked lines 26933 26946 +13
Branches 10058 10064 +6
==========================================
+ Hits 24321 24328 +7
- Misses 2612 2618 +6
- Partials 1518 1521 +3Generated by Coverage Action
3fc87ab to
d6cde74
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit d6cde74. Configure here.

Add a basic bedrock extension that sets the
gen_ai.operation.name,gen_ai.provider.nameandgen_ai.response.streamingattributes.This is the first boto3 extension. I've cleaned up some things:
registry.py. We control all extensions in the SDK, so this indirection seems unnecessary.test_bedrock.pyso the relevant behavior is still exercised.capture_internal_exceptions()around invocations of extension functions. If there's code that can raise in the extensions, the extensions can wrap the relevant lines themselves.skip_if_no_active_spanboolean so that Bedrock spans are created even when there is no active span, matching the behavior of other chat integrations.