Skip to content

feat(aiohttp): Gate user info behind data_collection config#6874

Open
ericapisani wants to merge 1 commit into
py-2583-pyramidfrom
py-2583-aiohttp
Open

feat(aiohttp): Gate user info behind data_collection config#6874
ericapisani wants to merge 1 commit into
py-2583-pyramidfrom
py-2583-aiohttp

Conversation

@ericapisani

@ericapisani ericapisani commented Jul 23, 2026

Copy link
Copy Markdown
Member

Apply the data_collection.user_info setting to the aiohttp integration's user IP collection under span streaming, giving it precedence over the legacy send_default_pii boolean when explicitly configured. This covers both the client.address span attribute and the user.ip_address scope attribute, mirroring the behavior already shipped for Flask, WSGI, ASGI, Django, Sanic, Tornado, and Pyramid.

Add test_user_address_with_data_collection_and_span_streaming, parametrized with the shared DATA_COLLECTION_USER_INFO_CASES matrix from tests/integrations/utils.py, and remove the now-redundant IP assertion block from test_sensitive_header_passthrough_with_pii_span_streaming that its TODO reserved for this change.

Refs PY-2583
Fixes #6746

Apply the data_collection.user_info setting to the aiohttp integration's user IP collection under span streaming, giving it precedence over the legacy send_default_pii boolean when explicitly configured. This covers both the client.address span attribute and the user.ip_address scope attribute, mirroring the behavior already shipped for Flask, WSGI, ASGI, Django, Sanic, Tornado, and Pyramid.

Add test_user_address_with_data_collection_and_span_streaming, parametrized with the shared DATA_COLLECTION_USER_INFO_CASES matrix from tests/integrations/utils.py, and remove the now-redundant IP assertion block from test_sensitive_header_passthrough_with_pii_span_streaming that its TODO reserved for this change.

Refs PY-2583
@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 19:10
@ericapisani
ericapisani requested a review from a team as a code owner July 23, 2026 19:10
@github-actions

Copy link
Copy Markdown
Contributor

Codecov Results 📊

96669 passed | ❌ 1 failed | ⏭️ 6409 skipped | Total: 103079 | Pass Rate: 93.78% | Execution Time: 348m 29s

📊 Comparison with Base Branch

Metric Change
Total Tests 📈 +809
Passed Tests 📈 +739
Failed Tests 📈 +1
Skipped Tests 📈 +69

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

Files with missing lines (1)
File Patch % Lines
sentry_sdk/integrations/aiohttp.py 100.00% ⚠️ 2 partials
Coverage diff
@@            Coverage Diff             @@
##          main       #PR       +/-##
==========================================
+ Coverage    89.68%    89.69%    +0.01%
==========================================
  Files          193       193         —
  Lines        24321     24375       +54
  Branches      8572      8628       +56
==========================================
+ Hits         21809     21861       +52
- Misses        2512      2514        +2
- Partials      1397      1401        +4

Generated by Codecov Action

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.

Support redacting/removing user data based on the data collection configuration

1 participant