Skip to content

feat(aiohttp): Remove request body capture from span streaming - #6297

Merged
ericapisani merged 1 commit into
masterfrom
py-2422-remove-request-body-aiohttp
May 19, 2026
Merged

feat(aiohttp): Remove request body capture from span streaming#6297
ericapisani merged 1 commit into
masterfrom
py-2422-remove-request-body-aiohttp

Conversation

@ericapisani

@ericapisaniericapisani commented May 19, 2026

Copy link
Copy Markdown
Member

Removes request body capture from aiohttp span streaming to reduce complexity.

The aiohttp integration previously captured the request body and set it as the
http.request.body.data span attribute during span streaming. This change
removes that functionality to simplify the integration, along with the
associated tests that verified the behavior.

Closes#6292
Fixes PY-2422

Remove logic that captured request body data on span segments in the
aiohttp integration when span streaming is enabled. This simplifies the
request handling flow and removes the need for post-handler body data
capture.
Also removes the following test cases that validated this behavior:
- test_request_body_captured_on_segment_span_streaming
- test_request_body_not_read_span_streaming
- test_request_body_over_size_limit_span_streaming
Remove unused imports from test file.
Fixes PY-2422
Fixes#6292
@linear-code

Copy link
Copy Markdown

PY-2422

@ericapisani
ericapisani marked this pull request as ready for review May 19, 2026 14:16
@ericapisani
ericapisani requested a review from a team as a code ownerMay 19, 2026 14:16

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an indentation change after the removal of the finally block that was setting the http.request.body.data attribute - it might be easier to review this outside the diff view

@github-actions

github-actionsBot commented May 19, 2026

Copy link
Copy Markdown
Contributor

Codecov Results 📊

155 passed | ⏭️ 2 skipped | Total: 157 | Pass Rate: 98.73% | Execution Time: 44.45s

📊 Comparison with Base Branch

MetricChange
Total Tests
Passed Tests
Failed Tests
Skipped Tests

✨ No test changes detected

All tests are passing successfully.

❌ Patch coverage is 0.00%. Project has 15504 uncovered lines.
❌ Project coverage is 30.62%. Comparing base (base) to head (head).

Files with missing lines (1)
FilePatch %Lines
aiohttp.py25.12%⚠️ 161 Missing and 2 partials
Coverage diff
@@ Coverage Diff @@## main #PR +/-##
==========================================
- Coverage 31.09% 30.62% -0.47%
==========================================
Files 190 190 —
Lines 22353 22346 -7
Branches 7584 7580 -4
==========================================
+ Hits 6950 6842 -108- Misses 15403 15504 +101- Partials 581 582 +1

Generated by Codecov Action

@alexander-alderman-webbalexander-alderman-webb 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.

Thanks!

@ericapisani
ericapisani merged commit 309b9d3 into masterMay 19, 2026
157 checks passed
@ericapisani
ericapisani deleted the py-2422-remove-request-body-aiohttp branch May 19, 2026 15:01
mgaligniana pushed a commit to mgaligniana/sentry-python that referenced this pull request Aug 9, 2026
…ntry#6297)
Removes request body capture from aiohttp span streaming to reduce
complexity.
The aiohttp integration previously captured the request body and set it
as the
`http.request.body.data` span attribute during span streaming. This
change
removes that functionality to simplify the integration, along with the
associated tests that verified the behavior.
Closesgetsentry#6292
Fixes PY-2422
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove request body capture in aiohttp

2 participants

@ericapisani@alexander-alderman-webb