Skip to content

ref(aws-lambda): Drop send_default_pii support - #7636

Merged
pabloDeputter merged 3 commits into
major/3.0from
pablo/aws-lambda-drop-pii
Sep 23, 2026
Merged

pabloDeputter merged 3 commits into
major/3.0from
pablo/aws-lambda-drop-pii

Conversation

@pabloDeputter

Copy link
Copy Markdown
Contributor

Description

  • drop send_default_pii support from aws-lambda integration.
  • explicitly use data_collection: {} in sentry_init(...) to fallback to default config.

Issues

Resolves #7585

@github-actions

github-actions Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Codecov Results 📊

✅ 64968 passed | ❌ 2 failed | ⏭️ 2971 skipped | Total: 67941 | Pass Rate: 95.62% | Execution Time: 189m 33s

📊 Comparison with Base Branch

Metric Change
Total Tests 📉 -68960
Passed Tests 📉 -64785
Failed Tests 📈 +2
Skipped Tests 📉 -4177

➕ New Tests (2)

View new tests
  • test_input_attributes_nonstreaming_chat[True-messages0-expected_system_instructions0-expected_input_messages0]
    • File: tests.integrations.mistral.test_mistral
    • Status: ❌ Failing
  • test_cache_spans_item_size
    • File: tests.integrations.django.test_cache_module
    • Status: ❌ Failing

❌ Failed Tests

test_input_attributes_nonstreaming_chat[True-messages0-expected_system_instructions0-expected_input_messages0]

File: tests.integrations.mistral.test_mistral
Suite: py3.10-mistral-v2.0.5
Error: KeyError: 140020003950592

Stack Trace
tests/integrations/mistral/test_mistral.py:380: in test_input_attributes_nonstreaming_chat
    sentry_init(
tests/conftest.py:349: in inner
    client = sentry_sdk.Client(*a, **kw)
sentry_sdk/client.py:278: in __init__
    self._init_impl()
sentry_sdk/client.py:428: in _init_impl
    self.integrations = setup_integrations(
sentry_sdk/integrations/__init__.py:216: in setup_integrations
    for integration_cls in iter_default_integrations(
sentry_sdk/integrations/__init__.py:44: in iter_default_integrations
    yield getattr(import_module(module), cls)
/usr/lib/python3.10/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
<frozen importlib._bootstrap>:1050: in _gcd_import
    ???
<frozen importlib._bootstrap>:1024: in _find_and_load
    ???
<frozen importlib._bootstrap>:171: in __enter__
    ???
<frozen importlib._bootstrap>:123: in acquire
    ???
E   KeyError: 140020003950592

test_cache_spans_item_size

File: tests.integrations.django.test_cache_module
Suite: py3.14-django-v6.1.1
Error: tests/integrations/django/test_cache_module.py:546: in test_cache_spans_item_size assert not spans[0]["attributes"]["cache.hit"] E assert not True

Stack Trace
tests/integrations/django/test_cache_module.py:546: in test_cache_spans_item_size
    assert not spans[0]["attributes"]["cache.hit"]
E   assert not True

❌ Patch coverage is 26.32%. Project has 2070 uncovered lines.
❌ Project coverage is 90.18%. Comparing base (7332ada) to head (aeaea34).

Files with missing lines (1)
File Patch % Lines
sentry_sdk/integrations/aws_lambda.py 26.32% ⚠️ 14 Missing and 2 partials
Coverage diff
@@            Coverage Diff             @@
##        master       #PR       +/-##
==========================================
- Coverage    90.22%    90.18%    -0.04%
==========================================
  Files          194       180       -14
  Lines        25997     21084     -4913
  Branches      9662      7600     -2062
==========================================
+ Hits         23454     19014     -4440
- Misses        2543      2070      -473
- Partials      1451      1198      -253

Generated by Codecov Action

@pabloDeputter
pabloDeputter force-pushed the pablo/aws-lambda-drop-pii branch from 232e4b9 to 7fbc174 Compare September 23, 2026 11:44
@pabloDeputter

Copy link
Copy Markdown
Contributor Author

pretty sure the low coverage is because it doesn't take into account the tests ran in the SAM containers

@pabloDeputter
pabloDeputter marked this pull request as ready for review September 23, 2026 12:07
@pabloDeputter
pabloDeputter requested a review from a team as a code owner September 23, 2026 12:07

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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good to me

@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 7fbc174. Configure here.

for key, value in extracted_user.items():
user_info.setdefault(key, value)

if "incoming_request" in data_collection["http_bodies"]:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Default config now sends request bodies

High Severity

Dropping the send_default_pii fallback makes raw request bodies attach whenever http_bodies includes incoming_request. The mapped default always includes that type, so layer and other unset-data_collection users now send unstructured bodies that the previous path marked as removed. Those payloads can contain credentials and other PII.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 7fbc174. Configure here.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think that's intended on the major

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

ok, I was a bit confused. It's also flagging this on the other PR's: #7637 (comment)

@pabloDeputter
pabloDeputter merged commit 172ae8c into major/3.0 Sep 23, 2026
144 of 147 checks passed
@pabloDeputter
pabloDeputter deleted the pablo/aws-lambda-drop-pii branch September 23, 2026 12:52
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.

2 participants