Skip to content

test(flask): Add span streaming test coverage#6264

Merged
ericapisani merged 10 commits into
masterfrom
py-2323-migrate-flask
May 19, 2026
Merged

test(flask): Add span streaming test coverage#6264
ericapisani merged 10 commits into
masterfrom
py-2323-migrate-flask

Conversation

@ericapisani
Copy link
Copy Markdown
Member

@ericapisani ericapisani commented May 13, 2026

Add test coverage to ensure that span streaming works for Flask. No additional changes are needed because we are no longer adding the request body to the streamed spans, and span streaming support has been added earlier to the uWSGI middleware which the Flask integration leverages.

Fixes PY-2323
Fixes #6021

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
@linear-code
Copy link
Copy Markdown

linear-code Bot commented May 13, 2026

PY-2323

@ericapisani
Copy link
Copy Markdown
Member Author

bugbot run

@ericapisani
Copy link
Copy Markdown
Member Author

@sentry review

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 13, 2026

Codecov Results 📊

282 passed | Total: 282 | Pass Rate: 100% | Execution Time: 42.54s

All tests are passing successfully.

❌ Patch coverage is 0.00%. Project has 14867 uncovered lines.

Files with missing lines (1)
File Patch % Lines
flask.py 12.50% ⚠️ 112 Missing

Generated by Codecov Action

Comment thread sentry_sdk/integrations/flask.py Outdated
Comment thread sentry_sdk/integrations/flask.py Outdated
Comment thread sentry_sdk/integrations/flask.py Outdated
@ericapisani ericapisani marked this pull request as ready for review May 14, 2026 13:55
@ericapisani ericapisani requested a review from a team as a code owner May 14, 2026 13:55
Copy link
Copy Markdown
Contributor

@alexander-alderman-webb alexander-alderman-webb left a comment

Choose a reason for hiding this comment

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

I just looked at the request body attribute since I'm solving this in Starlette right now, and the same problem applies here 😅

Comment thread sentry_sdk/integrations/flask.py Outdated
@ericapisani ericapisani marked this pull request as draft May 15, 2026 13:57
Comment thread sentry_sdk/integrations/flask.py Outdated
@ericapisani
Copy link
Copy Markdown
Member Author

bugbot run
@sentry review

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit b7c0ec6. Configure here.

Comment thread sentry_sdk/integrations/_wsgi_common.py Outdated
Comment thread sentry_sdk/integrations/flask.py
@ericapisani ericapisani changed the title feat(flask): Add span streaming support and request body capture test(flask): Add span streaming test coverage May 19, 2026
@ericapisani ericapisani marked this pull request as ready for review May 19, 2026 13:02
@alexander-alderman-webb
Copy link
Copy Markdown
Contributor

The tests seem to fail; feel free to merge after fixing them if it's a trivial problem.

Comment thread tests/integrations/flask/test_flask.py
@ericapisani ericapisani enabled auto-merge (squash) May 19, 2026 14:14
@ericapisani ericapisani merged commit ccf8f09 into master May 19, 2026
157 checks passed
@ericapisani ericapisani deleted the py-2323-migrate-flask branch May 19, 2026 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migrate flask to span first

2 participants