feat(flask): Add span streaming support and request body capture#6264
Draft
ericapisani wants to merge 2 commits into
Draft
feat(flask): Add span streaming support and request body capture#6264ericapisani wants to merge 2 commits into
ericapisani wants to merge 2 commits into
Conversation
Add request body data to the streaming segment span when span streaming is enabled. Update existing tests to cover both streaming and non-streaming code paths, and add new tests for request body capture, size limits, and header scrubbing in streaming mode. Fixes PY-2323 Fixes #6021
Member
Author
|
bugbot run |
Member
Author
|
@sentry review |
Contributor
Codecov Results 📊✅ 282 passed | Total: 282 | Pass Rate: 100% | Execution Time: 41.72s 📊 Comparison with Base Branch
✨ No test changes detected All tests are passing successfully. ❌ Patch coverage is 13.89%. Project has 14795 uncovered lines. Files with missing lines (3)
Coverage diff@@ Coverage Diff @@
## main #PR +/-##
==========================================
+ Coverage 28.45% 33.58% +5.13%
==========================================
Files 190 190 —
Lines 22250 22275 +25
Branches 7534 7544 +10
==========================================
+ Hits 6330 7480 +1150
- Misses 15920 14795 -1125
- Partials 606 747 +141Generated by Codecov Action |
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 c74acb1. Configure here.
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.

Add span streaming support to the Flask integration. When span streaming is enabled via
_experiments={"trace_lifecycle": "stream"}, the integration now captures request body data as an attribute on the segment span.The request body handling respects existing size limits and content type rules — oversized bodies get the substitution marker, unparseable raw data gets annotated accordingly (different from what we do today where we remove the value entirely).
Fixes PY-2323
Fixes #6021