Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 84 additions & 0 deletions docs/platforms/php/common/configuration/options.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,90 @@ This option is turned off by default.

If you enable this option, be sure to manually remove what you don't want to send using our features for managing [_Sensitive Data_](../../data-management/sensitive-data/).

<Alert>

For more fine-grained control, use the [`data_collection`](#data_collection) option. `send_default_pii` remains fully supported until the next major version.

If you set both, `send_default_pii` is ignored.

</Alert>

</SdkOption>

<PlatformSection notSupported={["php.laravel", "php.symfony"]}>

<SdkOption name="data_collection" type='array|\Sentry\DataCollection\DataCollectionOptions|null' defaultValue='null' availableSince="4.33.0">

Controls which categories of data the SDK collects automatically, replacing the single `send_default_pii` boolean with a per-category configuration. All keys are optional.

```php
\Sentry\init([
'dsn' => '___PUBLIC_DSN___',
'data_collection' => [
'user_info' => false,
'http_bodies' => ['incomingRequest'],
],
]);
```

Passing a `data_collection` array opts you into its defaults, which are more permissive than `send_default_pii` set to `false`. Any key you don't set falls back to its default, so the SDK collects rich debugging context (the user's IP address, cookies, and request and response bodies) and scrubs values whose keys match the built-in sensitive denylist (`auth`, `token`, `password`, and similar).

If you set both `data_collection` and `send_default_pii`, `send_default_pii` is ignored. The `context_lines` option is ignored as well, in favor of `frame_context_lines`.

For the full reference of available keys and their defaults, see <PlatformLink to="/data-management/data-collection/">Data Collection</PlatformLink>.

</SdkOption>

</PlatformSection>

<PlatformSection supported={["php.symfony"]}>

<SdkOption name="data_collection" type='array|null' defaultValue='null' availableSince="5.14.0">

Controls which categories of data the SDK collects automatically, replacing the single `send_default_pii` boolean with a per-category configuration. All keys are optional.

{/* prettier-ignore */}
```yaml {filename:config/packages/sentry.yaml}
sentry:
options:
data_collection:
user_info: false
http_bodies: ['incomingRequest']
```

Setting `data_collection` opts you into its defaults, which are more permissive than `send_default_pii` set to `false`. Any key you don't set falls back to its default, so the SDK collects rich debugging context (the logged-in user, cookies, request and response bodies, and database query parameters) and scrubs values whose keys match the built-in sensitive denylist (`auth`, `token`, `password`, and similar). Set it to `{}` to apply the defaults of every key.

If you set both `data_collection` and `send_default_pii`, `send_default_pii` is ignored. The `context_lines` option is ignored as well, in favor of `frame_context_lines`.

For the full reference of available keys and their defaults, see <PlatformLink to="/data-management/data-collection/">Data Collection</PlatformLink>.

</SdkOption>

</PlatformSection>

<PlatformSection supported={["php.laravel"]}>

<SdkOption name="data_collection" type='array|null' defaultValue='null' availableSince="4.29.0">

Controls which categories of data the SDK collects automatically, replacing the single `send_default_pii` boolean with a per-category configuration. All keys are optional.

```php {filename:config/sentry.php}
'data_collection' => [
'user_info' => false,
'http_bodies' => ['incomingRequest'],
],
```

Passing a `data_collection` array opts you into its defaults, which are more permissive than `send_default_pii` set to `false`. Any key you don't set falls back to its default, so the SDK collects rich debugging context (the logged-in user, cookies, request and response bodies, SQL query bindings, and AI prompts and responses) and scrubs values whose keys match the built-in sensitive denylist (`auth`, `token`, `password`, and similar). Pass an empty array to apply the defaults of every key.

If you set both `data_collection` and `send_default_pii`, `send_default_pii` is ignored. The `context_lines`, `breadcrumbs.sql_bindings`, and `tracing.sql_bindings` options are ignored as well, in favor of `frame_context_lines` and `database_query_data`.

For the full reference of available keys and their defaults, see <PlatformLink to="/data-management/data-collection/">Data Collection</PlatformLink>.

</SdkOption>

</PlatformSection>

<SdkOption name="server_name" type='string' defaultValue='gethostname()'>

This option can be used to supply a server name. When provided, the name of the server is sent along and persisted in the event. For many integrations, the server name actually corresponds to the device hostname, even in situations where the machine is not actually a server.
Expand Down Expand Up @@ -174,6 +256,8 @@ By default, the error types reported are determined by the value returned by the

The number of context lines for each frame in the stack trace when loading a file.

This option is ignored when [`data_collection`](#data_collection) is set. Use its <PlatformLink to="/data-management/data-collection/#source-context">`frame_context_lines`</PlatformLink> key instead.

</SdkOption>

## Tracing Options
Expand Down
8 changes: 8 additions & 0 deletions docs/platforms/php/common/data-management/data-collected.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ sidebar_order: 1

Sentry takes data privacy very seriously and has default settings in place that prioritize data safety, especially when it comes to personally identifiable information (PII) data. When you add the Sentry SDK to your application, you allow it to collect data and send it to Sentry during the runtime of your application.

<Alert>

For more fine-grained control, version 4.33.0 and later lets you opt in or out of each data category individually with the <PlatformLink to="/configuration/options/#data_collection">`data_collection` option</PlatformLink>. See <PlatformLink to="/data-management/data-collection/">Data Collection</PlatformLink> for details.

This page describes the behavior controlled by the <PlatformLink to="/configuration/options/#send_default_pii">`send_default_pii` option</PlatformLink>, which remains fully supported until the next major version.

</Alert>
Comment thread
Litarnus marked this conversation as resolved.
Resolved

The category types and amount of data collected vary, depending on the integrations you've enabled in the Sentry SDK. Here's a list of data categories the Sentry PHP SDK collects:

## HTTP Headers
Expand Down
Loading
Loading