Skip to content

feat(tornado): Gate user info behind data_collection config#6872

Open
ericapisani wants to merge 3 commits into
py-2583-sanic-user-infofrom
py-2583-tornado
Open

feat(tornado): Gate user info behind data_collection config#6872
ericapisani wants to merge 3 commits into
py-2583-sanic-user-infofrom
py-2583-tornado

Conversation

@ericapisani

@ericapisani ericapisani commented Jul 23, 2026

Copy link
Copy Markdown
Member

Apply the data_collection.user_info setting to the Tornado integration's user info collection, giving it precedence over the legacy send_default_pii boolean when explicitly configured. This covers the user.ip_address scope attribute applied to all spans, the client.address span attribute, and the is_authenticated user flag on error events, mirroring the behavior already shipped for Flask, WSGI, ASGI, Django, and Sanic.

The user IP span test is reparametrized with the shared DATA_COLLECTION_USER_INFO_CASES matrix from tests/integrations/utils.py, and new tests cover the previously untested client.address span attribute and the data_collection gating of the is_authenticated flag.

Refs PY-2583
Refs #6746

@linear-code

linear-code Bot commented Jul 23, 2026

Copy link
Copy Markdown

PY-2583

@ericapisani
ericapisani marked this pull request as ready for review July 23, 2026 15:05
@ericapisani
ericapisani requested a review from a team as a code owner July 23, 2026 15:05

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 4305b7d. Configure here.

Comment thread sentry_sdk/integrations/tornado.py
@github-actions

github-actions Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Codecov Results 📊

96588 passed | ⏭️ 6410 skipped | Total: 102998 | Pass Rate: 93.78% | Execution Time: 341m 7s

📊 Comparison with Base Branch

Metric Change
Total Tests 📈 +728
Passed Tests 📈 +658
Failed Tests
Skipped Tests 📈 +70

All tests are passing successfully.

✅ Patch coverage is 90.48%. Project has 2514 uncovered lines.
✅ Project coverage is 89.68%. Comparing base (base) to head (head).

Files with missing lines (1)
File Patch % Lines
sentry_sdk/integrations/tornado.py 90.48% ⚠️ 2 Missing and 3 partials
Coverage diff
@@            Coverage Diff             @@
##          main       #PR       +/-##
==========================================
+ Coverage    89.67%    89.68%    +0.01%
==========================================
  Files          193       193         —
  Lines        24321     24359       +38
  Branches      8572      8612       +40
==========================================
+ Hits         21809     21845       +36
- Misses        2512      2514        +2
- Partials      1397      1398        +1

Generated by Codecov Action

Apply the data_collection.user_info setting to the Tornado integration's user info collection, giving it precedence over the legacy send_default_pii boolean when explicitly configured. This covers the user.ip_address scope attribute applied to all spans, the client.address span attribute, and the is_authenticated user flag on error events, mirroring the behavior already shipped for Flask, WSGI, ASGI, Django, and Sanic.

The user IP span test is reparametrized with the shared DATA_COLLECTION_USER_INFO_CASES matrix from tests/integrations/utils.py, and new tests cover the previously untested client.address span attribute and the data_collection gating of the is_authenticated flag.

Refs PY-2583
@ericapisani
ericapisani force-pushed the py-2583-sanic-user-info branch from 4a557fc to 057caa4 Compare July 23, 2026 18:15
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.

1 participant