feat(data-collection): Add base DataCollection configuration with defaults and backfill - #3022
feat(data-collection): Add base DataCollection configuration with defaults and backfill#3022sl0thentr0py wants to merge 1 commit into
Conversation
e46836a to
2bd8779
Compare
99ba0b8 to
370c6c1
Compare
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 370c6c1. Configure here.
dingsdax
left a comment
There was a problem hiding this comment.
❤️ Ruby is just beautiful, lgtm 👍
solnic
left a comment
There was a problem hiding this comment.
LGTM, except this one tiny formatting issue.
199ed3f to
0b9189c
Compare
…aults and backfill
0b9189c to
3d85e61
Compare
| # the new DataCollection defaults are already correct if pii is enabled | ||
| data_collection = new |
There was a problem hiding this comment.
Bug: When send_default_pii is set to true, the DataCollection.backfill method incorrectly ignores the include_local_variables setting, preventing local variable capture.
Severity: MEDIUM
Suggested Fix
In DataCollection.backfill, when configuration.send_default_pii is true, migrate the include_local_variables and context_lines settings from the main configuration to the new data_collection object before returning. Specifically, set data_collection.stack_frame_variables = configuration.include_local_variables and data_collection.frame_context_lines = configuration.context_lines.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.
Location: sentry-ruby/lib/sentry/data_collection.rb#L125-L126
Potential issue: When `send_default_pii` is set to `true`, the `DataCollection.backfill`
method returns a new `DataCollection` object without migrating the user's
`include_local_variables` setting. This happens due to an early return. As a result,
`data_collection.stack_frame_variables` defaults to `false`, even if the user explicitly
set `include_local_variables=true`. This causes local variables from exception frames to
be silently dropped, contrary to the user's configuration. This behavior is inconsistent
with the `send_default_pii=false` path, which correctly migrates the setting.

Base branch for new
DataCollectionimplementation to deprecate and replacesend_default_pii.Spec: https://develop.sentry.dev/sdk/foundations/client/data-collection/
Issues
data_collectionconfig object, accessors & defaults #3000, feat(pii): Soft-deprecatesend_default_pii+ backwards-compatible mapping #3002data_collectionconfig object, accessors & defaults #3000, feat(pii): Soft-deprecatesend_default_pii+ backwards-compatible mapping #3002