feat(boto3): Add ServiceExtension class - #7536
Draft
pabloDeputter wants to merge 10 commits into
Draft
pabloDeputter wants to merge 10 commits into
pabloDeputter wants to merge 10 commits into
Conversation
pabloDeputter
added this pull request to stack #7500
September 18, 2026 13:31
Contributor
Codecov Results 📊✅ 130421 passed | ⏭️ 7171 skipped | Total: 137592 | Pass Rate: 94.79% | Execution Time: 445m 23s 📊 Comparison with Base Branch
All tests are passing successfully. ✅ Patch coverage is 84.75%. Project has 2566 uncovered lines. Files with missing lines (3)
Coverage diff@@ Coverage Diff @@
## master #PR +/-##
==========================================
+ Coverage 90.20% 90.25% +0.05%
==========================================
Files 194 201 +7
Lines 25888 26320 +432
Branches 9584 9752 +168
==========================================
+ Hits 23352 23754 +402
- Misses 2536 2566 +30
- Partials 1455 1462 +7Generated by Codecov Action |
pabloDeputter
removed this pull request from stack #7500
September 18, 2026 14:34
pabloDeputter
added this pull request to stack #7539
September 18, 2026 14:35
pabloDeputter
force-pushed
the
pablo/add-boto3-service-extension-class
branch
from
September 18, 2026 15:06
499dbcc to
d9609eb
Compare
pabloDeputter
removed this pull request from stack #7539
September 18, 2026 15:08
pabloDeputter
added this pull request to stack #7541
September 18, 2026 15:08
pabloDeputter
force-pushed
the
pablo/add-boto3-service-extension-class
branch
from
September 18, 2026 15:20
d9609eb to
ea505d1
Compare
Comment on lines
+208
to
+212
| service_op, service_origin = config | ||
| if isinstance(service_op, str) and service_op: | ||
| span_op = service_op | ||
| if isinstance(service_origin, str) and service_origin: | ||
| span_origin = service_origin |
Contributor
There was a problem hiding this comment.
Custom service origin skips streamed request enrichment
When a service extension overrides span origin, streamed spans fail the origin check in _sentry_request_created, so request attributes and _sentrysdk_span are never attached. Please keep the boto3 origin (or update that guard) if origin overrides are supported.
Evidence
- In
_start_client_span, a non-emptyservice_originfromservice_ext.get_span_config(ctx)replacesspan_originand is written toSPANDATA.SENTRY_ORIGINfor streamed spans. _sentry_request_createdreturns early when the current span is aStreamedSpanwhoseSPANDATA.SENTRY_ORIGINis not exactlyBoto3Integration.origin.- That early return skips
_set_request_attributes()and never setsrequest.context["_sentrysdk_span"]. test_service_extension_customizes_client_spanonly overrides op (("aws.test", None)), so this origin path is untested.
Also found at 1 additional location
sentry_sdk/integrations/boto3/_client.py:92-92
Identified by Warden · code-review, find-bugs · JFX-TK2
pabloDeputter
force-pushed
the
pablo/add-boto3-service-extension-class
branch
2 times, most recently
from
September 21, 2026 15:42
9068e22 to
b9071e2
Compare
pabloDeputter
force-pushed
the
pablo/add-boto3-service-extension-class
branch
from
September 21, 2026 16:07
b9071e2 to
787cd71
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds service-extension support to
Boto3Integration. This keeps the generic Boto3 call lifecycle independent of individual AWS services._ServiceExtensioninterface for service-specific behavior through_get_span_config(),_get_request_attributes(), and_get_response_attributes(). This allows for custom span operations/origin, request attributes, and response/error attributes. A future method can also inject trace context into service-specific payload, e.g. SQS message attributes.Issues
Resolves #7477