Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
4d1d3f5
ref(boto3): split integration into internal modules
pabloDeputter Sep 18, 2026
0c23830
ref(boto3): Move consts to
pabloDeputter Sep 21, 2026
b45f76c
fix(boto3): Move imports
pabloDeputter Sep 21, 2026
ab843bc
ref(boto3): Remove dupliocate `_check_minimum_version()`
pabloDeputter Sep 30, 2026
b21b888
ref(boto3): Update integration checks to use IDENTIFIER constant
pabloDeputter Sep 30, 2026
f91d311
fix(boto3): harden StreamingBody span finalization
pabloDeputter Sep 18, 2026
ec2a236
lint
pabloDeputter Sep 18, 2026
3b53fa4
ref(boto3): renaming vars
pabloDeputter Sep 21, 2026
eea1fc1
ref(boto3): Add specific comment on why we initialize with
pabloDeputter Sep 21, 2026
364f547
fix(boto3): ensure span finishes correctly when reading streaming body
pabloDeputter Sep 21, 2026
4f3cfce
fix(boto3): trace the complete client-call lifecycle
pabloDeputter Sep 21, 2026
644aff8
fix merging issues
pabloDeputter Sep 21, 2026
608ee4a
review changes
pabloDeputter Sep 21, 2026
ec8cef7
add test for when `StreamingBody` instrumentation setup fails
pabloDeputter Sep 21, 2026
3a60fb9
fix(boto3): finish streaming spans before legacy boto spans
pabloDeputter Sep 21, 2026
9c2f329
add permalink
pabloDeputter Sep 21, 2026
f9755ca
add some more comments
pabloDeputter Sep 21, 2026
a9e87f5
ref(boto3): use permalink
pabloDeputter Sep 29, 2026
2647da1
ref(boto3): fix grammar in comments
pabloDeputter Sep 29, 2026
8518c62
feat(boto3): improve boto3 integration
pabloDeputter Sep 21, 2026
7bf92dd
lint
pabloDeputter Sep 21, 2026
606c630
fix(boto3): overwrite server attributes when request URL is resolved
pabloDeputter Sep 22, 2026
74083ab
ref(boto3): move `aws-api` to `consts.py`
pabloDeputter Sep 29, 2026
7e5ba86
tests(boto3): move `span_streaming` inside method call
pabloDeputter Sep 29, 2026
6868ffd
ref(boto3): move `DEFAULT_PORTS` to `consts.py`
pabloDeputter Sep 29, 2026
d32a43f
ref(boto3): simplify client span lifecycle and header handling
pabloDeputter Sep 18, 2026
822438b
feat(boto3): add attributes to `consts.py`
pabloDeputter Sep 14, 2026
46d24b2
merge changes
pabloDeputter Sep 15, 2026
30d1e3f
add tests
pabloDeputter Sep 17, 2026
250699d
patch correct methods
pabloDeputter Sep 15, 2026
d9edef5
lint
pabloDeputter Sep 18, 2026
90383dc
use ordered search for request id and hist id
pabloDeputter Sep 18, 2026
d482500
ref(boto3): remove redundant span checks during enrichment
pabloDeputter Sep 18, 2026
26fdcb1
fix duplicates when merging
pabloDeputter Sep 18, 2026
eeac30a
use consts and string lookup for `client.getintegration`
pabloDeputter Sep 21, 2026
8b61aac
lint
pabloDeputter Sep 22, 2026
308eb5f
ruff
pabloDeputter Sep 22, 2026
8e4ce5a
ref(boto3): add permalinks
pabloDeputter Sep 29, 2026
832d90d
fix(boto3): add `error.type` to both span kinds
pabloDeputter Sep 29, 2026
0ee5f14
ref(boto3): specify docstring for `_set_span_attributes()` further
pabloDeputter Sep 29, 2026
a8f521e
ref(boto3): use f-string instead
pabloDeputter Sep 29, 2026
2d92b4e
ref(boto3): remove comment regarding `HTTP_REQUEST_RESEND_COUNT`
pabloDeputter Sep 29, 2026
12dd5e6
ref(boto3): remove `else` block
pabloDeputter Sep 29, 2026
21794bf
tests(boto3): remove uncessary testcases
pabloDeputter Sep 29, 2026
7859e97
ref(boto3): remove uncessary defensive conditionals
pabloDeputter Sep 29, 2026
1f4e936
fix flaky test
pabloDeputter Sep 30, 2026
02a8fa1
add base `ServiceExtension` class
pabloDeputter Sep 18, 2026
ee7e768
feat(boto3): Add service registry
pabloDeputter Sep 18, 2026
4d9ae30
add missing `__init__.py` file
pabloDeputter Sep 18, 2026
e90b407
simplify `_resolve_service()` logic
pabloDeputter Sep 18, 2026
af519a0
add service extension logic to `_instrumentation.py`
pabloDeputter Sep 18, 2026
98cc2a4
combine span-config extraction and validation in `_start_client_span()`
pabloDeputter Sep 18, 2026
ca7e449
add service extension logic to `_client.py`
pabloDeputter Sep 30, 2026
f95f4fe
add tests
pabloDeputter Sep 18, 2026
b0b9f0c
fix(boto3): Remove "hardcoded" origin
pabloDeputter Sep 22, 2026
7d645b4
feat(boto3): Add `sentry.kind` attribute to boto span
pabloDeputter Sep 22, 2026
64e1464
ref(boto3): Add comment explaining
pabloDeputter Sep 22, 2026
f221d72
Update sentry_sdk/integrations/boto3/_services/base.py
pabloDeputter Sep 29, 2026
a106f76
fix(boto3): correct `AWS_RPC_SYSTEM_NAME` constant
pabloDeputter Sep 29, 2026
032eff3
ref(boto3): refactor `get_span_config()` into `get_span_op()` and `ge…
pabloDeputter Sep 29, 2026
b1d9551
ref(boto3): remove attribute-precedence
pabloDeputter Sep 29, 2026
c2f4f6b
ref(boto3): remove lazy-loading approach; replace with static map
pabloDeputter Sep 30, 2026
a928e74
fix(boto3): make logic clearer
pabloDeputter Sep 30, 2026
2d85548
ref(boto3): change comment's and simplify logic
pabloDeputter Sep 30, 2026
9d2bd96
ref(boto3): remove defensive checks
pabloDeputter Sep 30, 2026
b65c0ca
ref(boto3): remove defensive checks and cleanup comments
pabloDeputter Sep 30, 2026
1270b49
cleanup tests
pabloDeputter Sep 30, 2026
91c9bdb
remove AI comment
pabloDeputter Sep 30, 2026
f2a2bc6
feat(attributes): Add s3 relevant attributes to `SPANDATA`
pabloDeputter Sep 22, 2026
0e948cb
feat(boto3): Register s3 to `_SERVICE_EXTENSIONS`
pabloDeputter Sep 30, 2026
a3629db
feat(boto3): Add attribute extraction helpers
pabloDeputter Sep 22, 2026
7c39a6c
feat(boto3): Add S3 extensio
pabloDeputter Sep 22, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix(boto3): ensure span finishes correctly when reading streaming body
  • Loading branch information
pabloDeputter committed Sep 30, 2026
commit 364f54776d3fa4fe7c1da526794ca7c67407820b
8 changes: 7 additions & 1 deletion sentry_sdk/integrations/boto3/_instrumentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ def _instrument_streaming_body(
raw_stream = body._raw_stream # type: ignore[attr-defined]
orig_raw_close = raw_stream.close
finished = False
read_in_progress = False

def finish_span(error: "Optional[BaseException]" = None) -> None:
nonlocal finished
Expand All @@ -236,6 +237,8 @@ def content_length_reached() -> bool:
)

def sentry_streaming_body_read(*args: "Any", **kwargs: "Any") -> bytes:
nonlocal read_in_progress
read_in_progress = True
try:
read_return_value = orig_read(*args, **kwargs)
with capture_internal_exceptions():
Expand All @@ -251,6 +254,8 @@ def sentry_streaming_body_read(*args: "Any", **kwargs: "Any") -> bytes:
except BaseException as error:
finish_span(error)
raise
finally:
read_in_progress = False

def sentry_streaming_body_close(*args: "Any", **kwargs: "Any") -> None:
try:
Expand All @@ -263,7 +268,8 @@ def sentry_streaming_body_close(*args: "Any", **kwargs: "Any") -> None:
def sentry_raw_stream_close(*args: "Any", **kwargs: "Any") -> None:
try:
orig_raw_close(*args, **kwargs)
finish_span()
if not read_in_progress:
finish_span()
except BaseException as error:
finish_span(error)
raise
Expand Down
2 changes: 2 additions & 0 deletions tests/integrations/boto3/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ def __init__(self, exception):
self._exception = exception

def read(self, *args, **kwargs):
# urllib3 closes the response before propagating some read failures.
self.close()
raise self._exception

def respond(request, **kwargs):
Expand Down
Loading