Skip to content

feat(pii): add data collection options - #2156

Open
Litarnus wants to merge 3 commits into
data-collection-basefrom
data-collection-config
Open

feat(pii): add data collection options#2156
Litarnus wants to merge 3 commits into
data-collection-basefrom
data-collection-config

Conversation

@Litarnus

@Litarnus Litarnus commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Adds DataCollectionOptions class which works as a container for all data collection specific options. It works similar to the already established Options class, but since options are already big enough I decided to move this into it's own class.

Init happens normally using nested arrays:

\Sentry\init([
    'data_collection' => [
        'http_headers' => [
            'request' => [
                'mode' => 'allowList'
            ]
        ]    
    ]
]);

Also implements ArrayAccess to make accessing nested fields more intuitive and to avoid constructs such as:

$options->getDataCollection()->getHttpHeaders()['request']['terms']

and we can instead use

$options->getDataCollection()['http_headers']['request']['terms']

@Litarnus
Litarnus marked this pull request as ready for review September 4, 2026 12:53
@Litarnus
Litarnus force-pushed the data-collection-config branch from 71a1512 to b8a9a41 Compare September 4, 2026 13:00
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