diff --git a/docs/platforms/android/configuration/options.mdx b/docs/platforms/android/configuration/options.mdx index 3ab6d49cb0fb43..e238edb2652651 100644 --- a/docs/platforms/android/configuration/options.mdx +++ b/docs/platforms/android/configuration/options.mdx @@ -100,6 +100,10 @@ AndroidManifest.xml key: `io.sentry.additional-context`. If this flag is enabled, certain personally identifiable information (PII) is added by active integrations. +This is a legacy flag. Use [`dataCollection`](#dataCollection) for granular control over automatically collected data. + +For backwards compatibility, `sendDefaultPii` keeps its existing behavior when no Data Collection field is configured. As soon as you configure any `dataCollection` field, Data Collection becomes the source of truth for its categories and `sendDefaultPii` no longer controls them. + If you are using Sentry in your mobile app, read our [frequently asked questions about mobile data privacy](/security-legal-pii/security/mobile-privacy/) to assist with Apple App Store and Google Play app privacy details. @@ -110,6 +114,106 @@ If you enable this option, be sure to manually remove what you don't want to sen + + +Controls which categories of data SDK integrations collect automatically. Data Collection applies only where an integration supports the category. It doesn't remove data you add explicitly through scopes, event processors, or callbacks such as `beforeSend`. + + + +Passing an empty `DataCollection` or explicitly configuring any field enables Data Collection. All fields you don't configure use the defaults below, and the `sendDefaultPii` option is ignored. + + + +| Field | Type | Default | Behavior | +| ------------------------ | ---------------------------- | -------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | +| `userInfo` | `boolean` | `true` | Allows integrations to populate user identity and IP address information. | +| `cookies`\* | `KeyValueCollectionBehavior` | `DENY_LIST` | Collects cookies and filters sensitive values. | +| `httpHeaders.request`\* | `KeyValueCollectionBehavior` | `DENY_LIST` | Collects request headers and filters sensitive values. | +| `httpHeaders.response`\* | `KeyValueCollectionBehavior` | `DENY_LIST` | Collects response headers and filters sensitive values. | +| `httpBodies` | `Set` | all body types | Collects supported incoming and outgoing request and response bodies. An empty set disables body collection. | +| `urlQueryParams`\* | `KeyValueCollectionBehavior` | `DENY_LIST` | Collects URL query parameters and filters sensitive values. | +| `graphql.document` | `boolean` | `true` | Collects GraphQL documents. | +| `graphql.variables` | `boolean` | `true` | Collects GraphQL variables. | +| `filePaths` | `boolean` | `true` | Allows File I/O instrumentation to collect file names and absolute paths. File extensions and byte counts remain available when disabled. | + +\* Fields marked with an asterisk take a single `KeyValueCollectionBehavior` value in code. Properties, environment variables, Spring Boot, and Android manifest metadata expose that value as separate `mode` and `terms` settings. `terms` contains additional matching terms for deny-list or allow-list behavior. + +The marked fields support three modes: + +- `OFF`: Don't collect the category. +- `DENY_LIST`: Collect values except those matching the built-in sensitive list or additional configured terms. +- `ALLOW_LIST`: Include plaintext values only for keys that match configured terms and don't match the built-in sensitive list. Sensitive values are always replaced with `"[Filtered]"`. + +Matching is partial and case-insensitive. The built-in list includes terms such as `auth`, `token`, `secret`, `password`, `key`, `session`, and `identity`. Filtered values are replaced with `"[Filtered]"`. Custom deny-list terms extend the built-in list rather than replacing it. + +Configure Data Collection in `AndroidManifest.xml`: + +```xml {filename:AndroidManifest.xml} + + + + + + + + +``` + +Supported manifest keys are: + +- `io.sentry.data-collection.user-info` +- `io.sentry.data-collection.http-bodies` +- `io.sentry.data-collection.cookies.mode` and `.terms` +- `io.sentry.data-collection.http-headers.request.mode` and `.terms` +- `io.sentry.data-collection.http-headers.response.mode` and `.terms` +- `io.sentry.data-collection.url-query-params.mode` and `.terms` +- `io.sentry.data-collection.graphql.document` +- `io.sentry.data-collection.graphql.variables` +- `io.sentry.data-collection.file-paths` + +For manual initialization, use the same Java API as the Java SDK: + +```kotlin +import io.sentry.KeyValueCollectionBehavior +import io.sentry.android.core.SentryAndroid + +SentryAndroid.init(this) { options -> + options.dataCollection.userInfo = false + options.dataCollection.filePaths = false + options.dataCollection.urlQueryParams = KeyValueCollectionBehavior.off() + options.dataCollection.httpHeaders.request = + KeyValueCollectionBehavior.allowList("content-type", "x-request-id") +} +``` + +### Migrating From `sendDefaultPii` + +Data Collection preserves existing applications until you opt in: + +| Configuration | Result | +| ------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | +| No Data Collection fields | Existing `sendDefaultPii` behavior is preserved. | +| An empty `DataCollection` | All Data Collection categories use the defaults above. | +| Any Data Collection field | That field uses its configured value, omitted fields use the defaults above, and `sendDefaultPii` is ignored for Data Collection categories. | + +If you previously used `sendDefaultPii=false`, either leave Data Collection unset to preserve that behavior or explicitly disable every category you don't want collected. If you used `sendDefaultPii=true`, an empty `DataCollection` opts into the new filtered defaults. + +Data Collection doesn't control Session Replay. Configure Replay's URL, header, and body collection separately in the Session Replay options. + + + When set to `true`, the SDK will send session events to Sentry. This is supported in all browser SDKs, emitting one session per pageload and page navigation to Sentry. In mobile SDKs, when the app goes to the background for longer than 30 seconds, sessions are ended. diff --git a/docs/platforms/android/data-management/data-collected.mdx b/docs/platforms/android/data-management/data-collected.mdx index 1bc7e3e6897925..d4df0cb605eab9 100644 --- a/docs/platforms/android/data-management/data-collected.mdx +++ b/docs/platforms/android/data-management/data-collected.mdx @@ -6,45 +6,47 @@ 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. -The category types and amount of data collected vary, depending on the integrations you've enabled in the Sentry SDK. This page lists data categories that the Sentry Android SDK collects. +The category types and amount of data collected vary, depending on the integrations you've enabled in the Sentry SDK. This page lists data categories that the Sentry Android SDK collects. Use to control automatic collection for supported categories. -Many of the categories listed here require you to enable the sendDefaultPii option. +After you configure any Data Collection field or pass an empty `DataCollection`, unconfigured fields use their documented defaults. + +Data Collection controls only data added automatically by SDK integrations. Data you add through scopes, event processors, `beforeSend`, or other APIs is still sent. ## HTTP Headers -By default, the Sentry SDK doesn't send any headers for outgoing HTTP requests. Even when sending HTTP headers is enabled, we have a [denylist](https://github.com/getsentry/sentry-java/blob/main/sentry/src/main/java/io/sentry/util/HttpUtils.java#L21-L34) in place, which filters out any headers that contain sensitive data. +Request and response headers use `DENY_LIST` by default. Supported integrations collect header names and non-sensitive values while replacing sensitive values with `"[Filtered]"`. -To start sending HTTP headers, set `sendDefaultPii=true`. Outside of the `sendDefaultPii` flag, you can opt to have specific headers captured in recorded user sessions. See the [Session Replay network detail options](/platforms/android/session-replay/configuration/) for more details. +Configure `dataCollection.httpHeaders.request` and `dataCollection.httpHeaders.response` to control header collection. OkHttp, Ktor Client, and Apollo 3 and 4 can attach available request and response headers to captured HTTP client errors. -## Cookies +Session Replay network details use [separate options](/platforms/android/session-replay/configuration/). -By default, the Sentry SDK doesn't send cookies. Sentry tries to remove any cookies that contain sensitive information, such as the Session ID and CSRF Token cookies. +## Cookies -If you want to send cookies, set `sendDefaultPii=true`. +Cookies use `DENY_LIST` by default. Supported integrations collect cookies while replacing sensitive values with `"[Filtered]"`. Use `dataCollection.cookies` to control cookie collection. ## Information About Logged-in User -By default, the Sentry SDK doesn't send any information about the logged-in user, such as email address, user ID, or username. Even if enabled, the type of logged-in user information you'll be able to send depends on the integrations you enable in Sentry's SDK. Most integrations won't send any user information. Some will only set the user ID, but there are a few that will set the user ID, username, and email address. +The SDK assigns a random installation ID when an event has no user ID. This ID is generated once per app installation and isn't controlled by Data Collection. -To start sending logged-in user information, set `sendDefaultPii=true`. +`dataCollection.userInfo` allows integrations to populate other user identity information automatically. It defaults to `true`. Set it to `false` to disable automatic user enrichment. User information you set explicitly with `Sentry.setUser()` or on a scope isn't removed. ## Users' IP Addresses -By default, the Sentry SDK doesn't send the user's IP address. Once enabled, the Sentry backend services will infer the user ip address based on the incoming request, unless certain integrations you can enable override this behavior. - -To enable sending the user's IP address, set `sendDefaultPii=true`. +When `dataCollection.userInfo` is `true`, the SDK adds `"{{auto}}"` as the user's IP address so Sentry can infer it from the connection. Set `dataCollection.userInfo=false` to disable automatic IP enrichment. ## Request URL -The full request URL of outgoing and incoming HTTP requests is **always sent to Sentry**. Depending on your application, this could contain PII data. +The request URL (without the query string) of outgoing and incoming HTTP requests is **always sent to Sentry**. Depending on your application, this could contain PII data. ## Request Query String -The full request query string of outgoing and incoming HTTP requests is **always sent to Sentry**. Depending on your application, this could contain PII data. +Query parameters use `DENY_LIST` by default. Use `dataCollection.urlQueryParams` to filter or disable query string collection for instrumented request URLs. ## Request and Response Bodies -By default, no request or response bodies are sent to Sentry from the Android SDK. If you want to collect request or response bodies in recorded user sessions, see the Session Replay [network detail configuration docs](/platforms/android/session-replay/configuration/). +All request and response body directions are enabled by default, but integrations collect bodies only where supported. Some integrations collect body content, while others collect only body sizes. + +Use `dataCollection.httpBodies` to choose which directions to collect or an empty set to disable body collection. Session Replay network body collection uses [separate options](/platforms/android/session-replay/configuration/). ## Source Context @@ -54,20 +56,26 @@ To opt into sending this source context to Sentry, you have to enable the featur ## File I/O -By default the Sentry SDK does not send the name or path of files when instrumenting File I/O. +File I/O instrumentation collects file names and absolute paths by default. Set `dataCollection.filePaths=false` to omit them. File extensions and byte counts remain available when paths are disabled. + +## Device Context -If you want to send file names and paths, set `sendDefaultPii=true`. +The SDK automatically collects device and operating-system context, including the manufacturer, model, architecture, orientation, display details, boot time, timezone, memory size, and emulator status. -## Device Information +Set `collectAdditionalContext=false` to reduce additional dynamic context such as battery level, available memory, storage state, and connectivity. -By default the Sentry SDK does not send the name of the device (Android phone). +## GraphQL Data -If you want to send the device name, set `sendDefaultPii=true`. +GraphQL document and variable collection default to `true`. Use `dataCollection.graphql.document` and `dataCollection.graphql.variables` to disable either category. Operation metadata used for tracing and grouping can still be collected when document or variable content is disabled. ## SQL Queries While SQL queries are sent to Sentry, neither the full SQL query (`UPDATE app_user SET password='supersecret' WHERE id=1;`), nor the values of its parameters will ever be sent. A parameterized version of the query (`UPDATE app_user SET password=? WHERE id=?;`) is sent instead. +## Logs + +Log messages, parameters, and breadcrumb content may contain application data. Data Collection doesn't filter this content. Use `beforeBreadcrumb` or `beforeSend` when you need application-specific filtering. + ## Session Replay By default, our Session Replay SDK masks all text content, images, webviews, and user input. This helps ensure that no sensitive data is exposed. You can find more details in the Session Replay documentation. diff --git a/docs/platforms/android/data-management/sensitive-data/index.mdx b/docs/platforms/android/data-management/sensitive-data/index.mdx index 5adffa96c8b96e..f3afe68c43d3c0 100644 --- a/docs/platforms/android/data-management/sensitive-data/index.mdx +++ b/docs/platforms/android/data-management/sensitive-data/index.mdx @@ -33,11 +33,11 @@ If you are using Sentry in your mobile app, read our [frequently asked questions ## Personally Identifiable Information (PII) -Our newer SDKs do not purposefully send PII to stay on the safe side. This behavior is controlled by an option called [`send-default-pii`](../../configuration/options/#sendDefaultPii). +Use [`dataCollection`](../../configuration/options/#dataCollection) to control user information, cookies, HTTP headers and bodies, URL query parameters, GraphQL content, and database query data added automatically by integrations. Its built-in filters replace sensitive key-value data with `"[Filtered]"` before the event leaves the device. -Turning this option on is required for certain features in Sentry to work, but also means you will need to be even more careful about what data is being sent to Sentry (using the options below). +Data Collection doesn't remove information you add explicitly. Use the hooks below for application-specific scrubbing, and review [Data Collected](../data-collected/) for categories that remain outside Data Collection. -If you _do not_ wish to use the default PII behavior, you can also choose to identify users in a more controlled manner, using our [user identity context](../../enriching-events/identify-user/). +The legacy [`sendDefaultPii`](../../configuration/options/#sendDefaultPii) option remains supported. If no Data Collection field is configured, the SDK preserves its existing behavior. Session Replay also keeps its separate privacy configuration. ## Scrubbing Data @@ -50,11 +50,11 @@ SDKs provide a hook, which is invoked Sensitive data may appear in the following areas: - Stack-locals → Some SDKs (Python, PHP and Node) will pick up variable values within the stack trace. These can be scrubbed, or this behavior can be disabled altogether if necessary. -- Breadcrumbs → Some SDKs (JavaScript and the Java logging integrations, for example) will pick up previously executed log statements. **Do not log PII** if using this feature and including log statements as breadcrumbs in the event. Some backend SDKs will also record database queries, which may need to be scrubbed. Most SDKs will add the HTTP query string and fragment as a data attribute to the breadcrumb, which may need to be scrubbed. -- User context → Automated behavior is controlled via . -- HTTP context → Query strings may be picked up in some frameworks as part of the HTTP request context. +- Breadcrumbs → Android integrations can capture previous log statements. **Do not log PII** when including logs as breadcrumbs. Data Collection filters query parameters on supported HTTP breadcrumbs, but application-defined breadcrumb data may still need custom scrubbing. +- User context → Automatic enrichment is controlled by [`dataCollection.userInfo`](../../configuration/options/#dataCollection). Explicitly set user data isn't removed. +- HTTP context → Use Data Collection to control supported cookies, headers, query parameters, and bodies. URL fragments aren't controlled by Data Collection. - Transaction Names → In certain situations, transaction names might contain sensitive data. For example, a browser's pageload transaction might have a raw URL like `/users/1234/details` as its name (where `1234` is a user id, which may be considered PII). In most cases, our SDKs can parameterize URLs and routes successfully, that is, turn `/users/1234/details` into `/users/:userid/details`. However, depending on the framework, your routing configuration, race conditions, and a few other factors, the SDKs might not be able to completely parameterize all of your URLs. -- HTTP Spans → Most SDKs will include the HTTP query string and fragment as a data attribute, which means the HTTP span may need to be scrubbed. +- HTTP spans → Data Collection filters query parameters added by supported integrations. Review URL fragments and span data you add yourself. For more details and data filtering instructions, see Filtering Events. diff --git a/docs/platforms/android/enriching-events/identify-user/index.mdx b/docs/platforms/android/enriching-events/identify-user/index.mdx index 832665e025e305..ae68705cfffcea 100644 --- a/docs/platforms/android/enriching-events/identify-user/index.mdx +++ b/docs/platforms/android/enriching-events/identify-user/index.mdx @@ -28,11 +28,10 @@ An alternative, or addition, to the username. Sentry is aware of email addresses ### `ip_address` The user's IP address. If the user is unauthenticated, Sentry uses the IP address as a unique identifier for the user. -Serverside SDKs that instrument incoming requests will attempt to pull the IP address from the HTTP request data (`request.env.REMOTE_ADDR` field in JSON), if available. That might require set to `true` in the SDK options. -If the user's `ip_address` is set to `"{{auto}}"`, Sentry will infer the IP address from the connection between your app and Sentry's server. +Set [`dataCollection.userInfo`](../../configuration/options/#dataCollection) to `true` to let the SDK add `"{{auto}}"` automatically. Sentry then infers the IP address from the connection between the device and Sentry's server. If Data Collection isn't configured, the SDK preserves the legacy behavior. -If the field is omitted, the default value is `null`. However, due to backwards compatibility concerns, certain platforms (in particular JavaScript) have a different default value for `"{{auto}}"`. SDKs and other clients should not rely on this behavior and should set IP addresses or `"{{auto}}"` explicitly. +If you set user data explicitly, Data Collection doesn't remove it. To opt out of storing users' IP addresses in your event data, users with project admin permissions (Org Owner, Org Manager, Team Admin, or Org Admin) can go to your project settings, click on "Security & Privacy", and enable "Prevent Storing of IP Addresses". Alternatively, use Sentry's [server-side data](/security-legal-pii/scrubbing/) scrubbing to remove `$user.ip_address`. Adding such a rule ultimately overrules any other logic. diff --git a/docs/platforms/android/index.mdx b/docs/platforms/android/index.mdx index 76b8cb4fa49aa8..4187676aa4ddf9 100644 --- a/docs/platforms/android/index.mdx +++ b/docs/platforms/android/index.mdx @@ -117,8 +117,9 @@ Configuration is done via the application `AndroidManifest.xml`. Here's an examp - - + + + diff --git a/docs/platforms/android/integrations/apollo3/index.mdx b/docs/platforms/android/integrations/apollo3/index.mdx index f349f0f22fd9d0..faa2c8dae3bdb9 100644 --- a/docs/platforms/android/integrations/apollo3/index.mdx +++ b/docs/platforms/android/integrations/apollo3/index.mdx @@ -158,17 +158,20 @@ val apollo = ApolloClient.builder() .build() ``` -By default, error events won't contain `Headers` or `Cookies`, but you can change this behavior by setting the `sendDefaultPii` option to `true`: +Use Data Collection to control headers, cookies, URL query parameters, request and response bodies, GraphQL documents, and GraphQL variables. For example, disable GraphQL variables and all HTTP body collection: ```xml {filename:AndroidManifest.xml} - + + ``` -Error events will contain the raw bodies of GraphQL requests and responses, which may include sensitive data. To avoid this, parameterize your queries using the [variables](https://spec.graphql.org/October2021/#sec-Language.Variables) field. [Relay](/product/relay) will then run [PII Data Scrubbing](/product/relay/#pii-data-scrubbing), automatically transforming values into `[Filtered]`. - -Alternatively, you can customize the event and scrub the data yourself. +Configuring any field activates the Data Collection defaults for omitted fields. GraphQL request and response bodies may contain sensitive data, so review both `graphql` and `httpBodies` before enabling them. You can also customize the event and scrub application-specific data yourself. ### Customize or Drop the Error Event diff --git a/docs/platforms/android/integrations/apollo4/index.mdx b/docs/platforms/android/integrations/apollo4/index.mdx index f18825566d98ab..b32fccaf59fdc5 100644 --- a/docs/platforms/android/integrations/apollo4/index.mdx +++ b/docs/platforms/android/integrations/apollo4/index.mdx @@ -154,23 +154,20 @@ val apollo = ApolloClient.builder() .build() ``` -By default, error events won't contain `Headers` or `Cookies`, but you can change this behavior by setting the `sendDefaultPii` option to `true`: - -```kotlin -Sentry.init { options -> - options.isSendDefaultPii = true -} -``` +Use Data Collection to control headers, cookies, URL query parameters, request and response bodies, GraphQL documents, and GraphQL variables. For example, disable GraphQL variables and all HTTP body collection: ```xml {filename:AndroidManifest.xml} - + + ``` -Error events will contain the raw bodies of GraphQL requests and responses, which may include sensitive data. To avoid this, parameterize your queries using the [variables](https://spec.graphql.org/October2021/#sec-Language.Variables) field. [Relay](/product/relay) will then run [PII Data Scrubbing](/product/relay/#pii-data-scrubbing), automatically transforming values into `[Filtered]`. - -Alternatively, you can customize the event and scrub the data yourself. +Configuring any field activates the Data Collection defaults for omitted fields. GraphQL request and response bodies may contain sensitive data, so review both `graphql` and `httpBodies` before enabling them. You can also customize the event and scrub application-specific data yourself. ### Customize or Drop the Error Event diff --git a/docs/platforms/android/integrations/ktor-client/index.mdx b/docs/platforms/android/integrations/ktor-client/index.mdx index 8278b5ff0b4b7c..3b51190bc69f9f 100644 --- a/docs/platforms/android/integrations/ktor-client/index.mdx +++ b/docs/platforms/android/integrations/ktor-client/index.mdx @@ -143,14 +143,24 @@ val ktorClient = HttpClient(Android) { } ``` -By default, error events won't contain any PII data, such as `Headers` and `Cookies`, but you can change this behavior by setting the `sendDefaultPii` option to `true`: +Use Data Collection to control the request and response headers, cookies, and URL query parameters attached to error events. For example, allow selected request headers and omit cookies: ```xml {filename:AndroidManifest.xml} - + + + ``` +Configuring any field activates the Data Collection defaults for omitted fields. Sensitive values still use the built-in filtering rules. + Those events are searchable and you can set alerts on them if you use the `http.url` and `http.status_code` properties. Learn more in our full [Searchable Properties](/concepts/search/searchable-properties/) documentation. ### Customize or Drop the Error Event diff --git a/docs/platforms/android/integrations/okhttp/index.mdx b/docs/platforms/android/integrations/okhttp/index.mdx index 56402df144e643..003a1c2187e9da 100644 --- a/docs/platforms/android/integrations/okhttp/index.mdx +++ b/docs/platforms/android/integrations/okhttp/index.mdx @@ -387,14 +387,24 @@ private final OkHttpClient client = new OkHttpClient.Builder() .build(); ``` -By default, error events won't contain any PII data, such as `Headers` and `Cookies`, but you can change this behavior by setting the `sendDefaultPii` option to `true`: +Use Data Collection to control the request and response headers, cookies, and URL query parameters attached to error events. For example, allow selected request headers and omit cookies: ```xml {filename:AndroidManifest.xml} - + + + ``` +Configuring any field activates the Data Collection defaults for omitted fields. Sensitive values still use the built-in filtering rules. + Those events are searchable and you can set alerts on them if you use the `http.url` and `http.status_code` properties. Learn more in our full [Searchable Properties](/concepts/search/searchable-properties/) documentation. ### Customize or Drop the Error Event diff --git a/docs/platforms/android/manual-setup/index.mdx b/docs/platforms/android/manual-setup/index.mdx index 6de84aa4c2bd94..0ec254ec436089 100644 --- a/docs/platforms/android/manual-setup/index.mdx +++ b/docs/platforms/android/manual-setup/index.mdx @@ -58,8 +58,9 @@ Configuration is done via the application `AndroidManifest.xml`. Here's an examp - - + + + @@ -129,6 +130,7 @@ The SDK can catch errors and crashes only after you've initialized it. For that Configuration options will be loaded from the manifest so that you don't need to have the static properties in your code. In the `init` method, you can provide a callback that will modify the configuration and also register new options. ```kotlin +import io.sentry.DataCollection; import io.sentry.ScreenshotStrategyType; import io.sentry.SentryLevel; import io.sentry.ProfileLifecycle; @@ -143,8 +145,11 @@ class MyApplication : Application() { SentryAndroid.init(this) { options -> // Required: set your sentry.io project identifier (DSN) options.dsn = "___PUBLIC_DSN___" - // Add data like request headers, user ip address and device name, see https://docs.sentry.io/platforms/android/data-management/data-collected/ for more info - options.isSendDefaultPii = true + // Use Data Collection defaults but don't collect automatic user information. + // https://docs.sentry.io/platforms/android/data-management/data-collected/ + options.dataCollection = DataCollection().apply { + userInfo = false + } // enable automatic traces for user interactions (clicks, swipes, scrolls) options.isEnableUserInteractionTracing = true // enable screenshot for crashes @@ -187,6 +192,7 @@ class MyApplication : Application() { ``` ```java +import io.sentry.DataCollection; import io.sentry.ScreenshotStrategyType; import io.sentry.SentryLevel; import io.sentry.ProfileLifecycle; @@ -200,8 +206,11 @@ public class MyApplication extends Application { SentryAndroid.init(this, options -> { // Required: set your sentry.io project identifier (DSN) options.setDsn("___PUBLIC_DSN___"); - // Add data like request headers, user ip address and device name, see https://docs.sentry.io/platforms/android/data-management/data-collected/ for more info - options.setSendDefaultPii(true); + // Use Data Collection defaults but don't collect automatic user information. + // https://docs.sentry.io/platforms/android/data-management/data-collected/ + DataCollection dataCollection = new DataCollection(); + dataCollection.setUserInfo(false); + options.setDataCollection(dataCollection); // enable automatic traces for user interactions (clicks, swipes, scrolls) options.setEnableUserInteractionTracing(true); // enable screenshot for crashes diff --git a/docs/platforms/java/common/configuration/options.mdx b/docs/platforms/java/common/configuration/options.mdx index 8b1e769fb5cf06..82ac312d2553ca 100644 --- a/docs/platforms/java/common/configuration/options.mdx +++ b/docs/platforms/java/common/configuration/options.mdx @@ -108,6 +108,113 @@ 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/). +This is a legacy flag. Use [`dataCollection`](#dataCollection) for granular control over automatically collected data. + +For backwards compatibility, `sendDefaultPii` keeps its existing behavior when no Data Collection field is configured. As soon as you configure any `dataCollection` field, Data Collection becomes the source of truth for its categories and `sendDefaultPii` no longer controls them. + +Unencoded Logback messages aren't a Data Collection category. To include original message templates and parameters when an encoder is configured, use the Logback appender's `includeUnencodedMessage` option. The legacy `sendDefaultPii` behavior remains supported for compatibility. OpenTelemetry-derived HTTP header attributes also aren't controlled by Data Collection yet and continue to use `sendDefaultPii`. + + + + + +Controls which categories of data SDK integrations collect automatically. Data Collection applies only where an integration supports the category. It doesn't remove data you add explicitly through scopes, event processors, or callbacks such as `beforeSend`. + + + +Passing an empty `DataCollection` or explicitly configuring any field enables Data Collection. All fields you don't configure use the defaults below, and the `sendDefaultPii` option is ignored. + + + +| Field | Type | Default | Behavior | +| ------------------------ | ---------------------------- | -------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | +| `userInfo` | `boolean` | `true` | Allows integrations to populate user identity and IP address information. | +| `cookies`\* | `KeyValueCollectionBehavior` | `DENY_LIST` | Collects cookies and filters sensitive values. | +| `httpHeaders.request`\* | `KeyValueCollectionBehavior` | `DENY_LIST` | Collects request headers and filters sensitive values. | +| `httpHeaders.response`\* | `KeyValueCollectionBehavior` | `DENY_LIST` | Collects response headers and filters sensitive values. | +| `httpBodies` | `Set` | all body types | Collects supported incoming and outgoing request and response bodies. An empty set disables body collection. | +| `urlQueryParams`\* | `KeyValueCollectionBehavior` | `DENY_LIST` | Collects URL query parameters and filters sensitive values. | +| `graphql.document` | `boolean` | `true` | Collects GraphQL documents. | +| `graphql.variables` | `boolean` | `true` | Collects GraphQL variables. | +| `filePaths` | `boolean` | `true` | Allows File I/O instrumentation to collect file names and absolute paths. File extensions and byte counts remain available when disabled. | + +\* Fields marked with an asterisk take a single `KeyValueCollectionBehavior` value in code. Properties, environment variables, Spring Boot, and Android manifest metadata expose that value as separate `mode` and `terms` settings. `terms` contains additional matching terms for deny-list or allow-list behavior. + +The `cookies`, `httpHeaders.request`, `httpHeaders.response`, and `urlQueryParams` fields support three modes: + +- `OFF`: Don't collect the category. +- `DENY_LIST`: Collect values except those matching the built-in sensitive list or additional configured terms. +- `ALLOW_LIST`: Include plaintext values only for keys that match configured terms and don't match the built-in sensitive list. Sensitive values are always replaced with `"[Filtered]"`. + +Matching is partial and case-insensitive. The built-in list includes terms such as `auth`, `token`, `secret`, `password`, `key`, `session`, and `identity`. Filtered values are replaced with `"[Filtered]"`. Custom deny-list terms extend the built-in list rather than replacing it. + +Configure only the fields that differ from these defaults: + +```java +import io.sentry.KeyValueCollectionBehavior; +import io.sentry.Sentry; + +Sentry.init( + options -> { + options.getDataCollection().setUserInfo(false); + options.getDataCollection().setFilePaths(false); + options + .getDataCollection() + .setUrlQueryParams(KeyValueCollectionBehavior.off()); + options + .getDataCollection() + .getHttpHeaders() + .setRequest( + KeyValueCollectionBehavior.allowList( + "content-type", "x-request-id")); + }); +``` + +You can also configure Data Collection through external properties: + +```properties {filename:sentry.properties} +data-collection.user-info=false +data-collection.http-bodies=incoming_request,outgoing_request +data-collection.cookies.mode=deny_list +data-collection.cookies.terms=session-id,tracking-id +data-collection.http-headers.request.mode=allow_list +data-collection.http-headers.request.terms=content-type,x-request-id +data-collection.http-headers.response.mode=off +data-collection.url-query-params.mode=off +data-collection.graphql.document=false +data-collection.graphql.variables=false +data-collection.file-paths=false +``` + +Environment variables use the same names in uppercase with the `SENTRY_` prefix, for example, `SENTRY_DATA_COLLECTION_USER_INFO`, `SENTRY_DATA_COLLECTION_HTTP_BODIES`, and `SENTRY_DATA_COLLECTION_FILE_PATHS`. + + + +Spring Boot uses the `sentry.` prefix and kebab-case enum values: + +```properties {filename:application.properties} +sentry.data-collection.user-info=false +sentry.data-collection.http-bodies=incoming-request,outgoing-request +sentry.data-collection.http-headers.request.mode=allow-list +sentry.data-collection.http-headers.request.terms=content-type,x-request-id +sentry.data-collection.url-query-params.mode=off +sentry.data-collection.file-paths=false +``` + + + +### Migrating From `sendDefaultPii` + +Data Collection preserves existing applications until you opt in: + +| Configuration | Result | +| ------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | +| No Data Collection fields | Existing `sendDefaultPii` behavior is preserved. | +| An empty `DataCollection` | All Data Collection categories use the defaults above. | +| Any Data Collection field | That field uses its configured value, omitted fields use the defaults above, and `sendDefaultPii` is ignored for Data Collection categories. | + +If you previously used `sendDefaultPii=false`, either leave Data Collection unset to preserve that behavior or explicitly disable every category you don't want collected. If you used `sendDefaultPii=true`, an empty `DataCollection` opts into the new filtered defaults. For unencoded Logback messages, use `includeUnencodedMessage` as described in the [Logback documentation](/platforms/java/guides/logback/). Keep `sendDefaultPii=true` only if you need the legacy OpenTelemetry header behavior. + @@ -149,8 +256,7 @@ This parameter controls whether integrations should capture HTTP request bodies. - `medium`: Medium and small requests will be captured (typically 10KB). - `always`: The SDK will always capture the request body as long as Sentry can make sense of it. -For request bodies to be captured, the flag must also be enabled. -Please consult the documentation for to evaluate whether you would want to enable it, making sure to manually remove the data you don't want to send using our features for managing Sensitive Data. +When Data Collection is configured, [`dataCollection.httpBodies`](#dataCollection) controls supported request and response bodies instead. `maxRequestBodySize` remains the size limit for integrations that use it. diff --git a/docs/platforms/java/common/data-management/data-collected.mdx b/docs/platforms/java/common/data-management/data-collected.mdx index 7c5a1d3190d602..65016bb99e7ecb 100644 --- a/docs/platforms/java/common/data-management/data-collected.mdx +++ b/docs/platforms/java/common/data-management/data-collected.mdx @@ -6,53 +6,43 @@ 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. -The category types and amount of data collected vary, depending on the integrations you've enabled in the Sentry SDK. This page lists data categories that the Sentry Java SDK collects. +The category types and amount of data collected vary, depending on the integrations you've enabled in the Sentry SDK. This page lists data categories that the Sentry Java SDK collects. Use to control automatic collection for supported categories. -For many of the categories listed here it is required to enable the sendDefaultPii option. +After you configure any Data Collection field or pass an empty `DataCollection`, unconfigured fields use their documented defaults. -## HTTP Headers - -### Outgoing Requests - -By default, the Sentry SDK doesn't send any headers for outgoing HTTP requests. Even when sending HTTP headers is enabled, we have a [denylist](https://github.com/getsentry/sentry-java/blob/main/sentry/src/main/java/io/sentry/util/HttpUtils.java#L21-L34) in place, which filters out any headers that contain sensitive data. - -To send all HTTP headers, set `sendDefaultPii=true`. +Data Collection controls only data added automatically by SDK integrations. Data you add through scopes, event processors, `beforeSend`, or other APIs is still sent. -### Incoming Requests +## HTTP Headers -By default, the Sentry SDK sends headers for incoming HTTP requests to Sentry but filters out any headers that contain sensitive data. (See the [list of headers](https://github.com/getsentry/sentry-java/blob/main/sentry/src/main/java/io/sentry/util/HttpUtils.java#L21-L34) that are filtered). +Request and response headers use `DENY_LIST` by default. Supported integrations collect header names and non-sensitive values while replacing sensitive values with `"[Filtered]"`. -To send all HTTP headers, set `sendDefaultPii=true`. +Configure `dataCollection.httpHeaders.request` and `dataCollection.httpHeaders.response` to control header collection. Servlet and Spring integrations can collect incoming request headers. OkHttp, Ktor Client, and Apollo can attach request and response headers to captured HTTP client errors. ## Cookies -By default, the Sentry SDK doesn't send cookies. Sentry tries to remove any cookies that contain sensitive information, such as the Session ID and CSRF Token cookies. - -If you want to send cookies, set `sendDefaultPii=true`. +Cookies use `DENY_LIST` by default. Supported integrations collect cookies while replacing sensitive values with `"[Filtered]"`. Use `dataCollection.cookies` to control cookie collection. ## Information About Logged-in User -By default, the Sentry SDK doesn't send any information about the logged-in user, such as email address, user ID, or username. Even if enabled, the type of logged-in user information you'll be able to send depends on the integrations you enable in Sentry's SDK. Most integrations won't send any user information. Some will only set the user ID, but there are a few that will set the user ID, username, and email address. - -To start sending logged-in user information, set `sendDefaultPii=true`. +`dataCollection.userInfo` allows integrations to populate user identity information automatically, including Spring Security usernames and the user's IP address. It defaults to `true`. Set it to `false` to disable automatic user enrichment. User information you set explicitly with `Sentry.setUser()` or on a scope isn't removed. ## Users' IP Addresses -By default, the Sentry SDK doesn't send the user's IP address. Once enabled, the Sentry backend services will infer the user ip address based on the incoming request, unless certain integrations you can enable override this behavior. - -To enable sending the user's IP address, set `sendDefaultPii=true`. +When `dataCollection.userInfo` is `true`, the SDK adds `"{{auto}}"` as the user's IP address so Sentry can infer it from the connection. Set `dataCollection.userInfo=false` to disable automatic IP enrichment. ## Request URL -The full request URL of outgoing and incoming HTTP requests is **always sent to Sentry**. Depending on your application, this could contain PII data. +The request URL (without the query string) of outgoing and incoming HTTP requests is **always sent to Sentry**. Depending on your application, this could contain PII data. ## Request Query String -The full request query string of outgoing and incoming HTTP requests is **always sent to Sentry**. Depending on your application, this could contain PII data. +Query parameters use `DENY_LIST` by default. Use `dataCollection.urlQueryParams` to filter or disable query string collection for instrumented incoming and outgoing URLs, including HTTP spans and breadcrumbs created by integrations such as Spring and OpenFeign. ## Request Body -The request body of incoming HTTP requests can be sent to Sentry. Whether it's sent or not, depends on the type and size of request body as described below: +All request and response body directions are enabled by default, but integrations collect bodies only where supported. Some integrations collect body content, while others collect only body sizes. + +Use `dataCollection.httpBodies` to choose which directions to collect or an empty set to disable body collection. For incoming HTTP request bodies, the type and size restrictions below also apply: - **The type of the request body:** - JSON and form bodies are sent @@ -66,15 +56,21 @@ To opt into sending this source context to Sentry, you have to enable the featur ## File I/O -By default the Sentry SDK does not send the name or path of files when instrumenting File I/O. - -If you want to send file names and paths, set `sendDefaultPii=true`. +File I/O instrumentation collects file names and absolute paths by default. Set `dataCollection.filePaths=false` to omit them. File extensions and byte counts remain available when paths are disabled. ## Log Messages By default the Sentry SDK does not send unencoded Logback messages and parameters if an encoder has been set. It will however send the encoded message. -If you want to send the unencoded message and parameters, set `sendDefaultPii=true`. +Set `includeUnencodedMessage=true` on the Sentry appender to include the original message and parameters. Data Collection doesn't filter log messages or breadcrumb content. Use `beforeBreadcrumb` or `beforeSend` when you need application-specific filtering. + +## GraphQL Data + +GraphQL document and variable collection default to `true`. Use `dataCollection.graphql.document` and `dataCollection.graphql.variables` to disable either category. Operation metadata used for tracing and grouping can still be collected when document or variable content is disabled. + +## OpenTelemetry Attributes + +Data Collection doesn't filter attributes added by OpenTelemetry instrumentation or your application. Configure the instrumentation that produces them, or scrub them with `beforeSendTransaction`. ## SQL Queries diff --git a/docs/platforms/java/common/data-management/sensitive-data/index.mdx b/docs/platforms/java/common/data-management/sensitive-data/index.mdx index dd1f3937c4be57..8c48c3e1e0a284 100644 --- a/docs/platforms/java/common/data-management/sensitive-data/index.mdx +++ b/docs/platforms/java/common/data-management/sensitive-data/index.mdx @@ -31,11 +31,11 @@ Ensure that your team is aware of your company's policy around what can and cann ## Personally Identifiable Information (PII) -The SDK purposefully does not send PII to stay on the safe side. This behavior is controlled by an option called [`send-default-pii`](../../configuration/options/#sendDefaultPii). +Use [`dataCollection`](../../configuration/options/#dataCollection) to control user information, cookies, HTTP headers and bodies, URL query parameters, GraphQL content, and database query data added automatically by integrations. Its built-in filters replace sensitive key-value data with `"[Filtered]"` before the event leaves your application. -Turning this option on is required for certain features in Sentry to work, but also means you will need to be even more careful about what data is being sent to Sentry (using the options below). +Data Collection doesn't remove information you add explicitly. Use the hooks below for application-specific scrubbing, and review [Data Collected](../data-collected/) for categories that remain outside Data Collection. -If you _do not_ wish to use the default PII behavior, you can also choose to identify users in a more controlled manner, using our [user identity context](../../enriching-events/identify-user/). +The legacy [`sendDefaultPii`](../../configuration/options/#sendDefaultPii) option remains supported. If no Data Collection field is configured, the SDK preserves its existing behavior. ## Scrubbing Data @@ -48,11 +48,11 @@ The SDK provides a hook, which is invo Sensitive data may appear in the following areas: - Stack-locals → Some SDKs (Python, PHP and Node) will pick up variable values within the stack trace. These can be scrubbed, or this behavior can be disabled altogether if necessary. -- Breadcrumbs → Some SDKs (JavaScript and the Java logging integrations, for example) will pick up previously executed log statements. **Do not log PII** if using this feature and including log statements as breadcrumbs in the event. Some backend SDKs will also record database queries, which may need to be scrubbed. Most SDKs will add the HTTP query string and fragment as a data attribute to the breadcrumb, which may need to be scrubbed. -- User context → Automated behavior is controlled via . -- HTTP context → Query strings may be picked up in some frameworks as part of the HTTP request context. +- Breadcrumbs → Java logging integrations can capture previous log statements. **Do not log PII** when including logs as breadcrumbs. Data Collection filters query parameters on supported HTTP breadcrumbs, but application-defined breadcrumb data may still need custom scrubbing. +- User context → Automatic enrichment is controlled by [`dataCollection.userInfo`](../../configuration/options/#dataCollection). Explicitly set user data isn't removed. +- HTTP context → Use Data Collection to control supported cookies, headers, query parameters, and bodies. URL fragments aren't controlled by Data Collection. - Transaction Names → In certain situations, transaction names might contain sensitive data. For example, a browser's pageload transaction might have a raw URL like `/users/1234/details` as its name (where `1234` is a user id, which may be considered PII). In most cases, our SDKs can parameterize URLs and routes successfully, that is, turn `/users/1234/details` into `/users/:userid/details`. However, depending on the framework, your routing configuration, race conditions, and a few other factors, the SDKs might not be able to completely parameterize all of your URLs. -- HTTP Spans → Most SDKs will include the HTTP query string and fragment as a data attribute, which means the HTTP span may need to be scrubbed. +- HTTP spans → Data Collection filters query parameters added by supported integrations. Review URL fragments and span data you add yourself. For more details and data filtering instructions, see Filtering Events. diff --git a/docs/platforms/java/common/enriching-events/identify-user/index.mdx b/docs/platforms/java/common/enriching-events/identify-user/index.mdx index f3fc8162a988bd..0ae76790d0559a 100644 --- a/docs/platforms/java/common/enriching-events/identify-user/index.mdx +++ b/docs/platforms/java/common/enriching-events/identify-user/index.mdx @@ -22,7 +22,8 @@ An alternative, or addition, to the username. Sentry is aware of email addresses ### `ip_address` The user's IP address. If the user is unauthenticated, Sentry uses the IP address as a unique identifier for the user. -The SDK will attempt to pull the IP address from the HTTP request data on incoming requests (`request.env.REMOTE_ADDR` field in JSON), if available. That requires set to `true` in the SDK options. + +Set [`dataCollection.userInfo`](../../configuration/options/#dataCollection) to `true` to allow supported integrations to populate IP addresses automatically. If Data Collection isn't configured, the SDK preserves the legacy behavior. If the user's `ip_address` is set to `"{{auto}}"`, Sentry will infer the IP address from the connection between your app and Sentry's server. If the field is omitted, the default value is `null`. diff --git a/docs/platforms/java/common/integrations/graphql.mdx b/docs/platforms/java/common/integrations/graphql.mdx index 5e1d2c092326d5..b9ae57ef78977d 100644 --- a/docs/platforms/java/common/integrations/graphql.mdx +++ b/docs/platforms/java/common/integrations/graphql.mdx @@ -114,6 +114,24 @@ The `SentryDataFetcherExceptionHandler` has been deprecated. Please upgrade to ` +## Control GraphQL Content + +GraphQL documents, variables, and supported request and response bodies can contain sensitive application data. Use Data Collection to control them independently: + +```java +import io.sentry.Sentry; +import java.util.Collections; + +Sentry.init( + options -> { + options.getDataCollection().getGraphql().setDocument(false); + options.getDataCollection().getGraphql().setVariables(false); + options.getDataCollection().setHttpBodies(Collections.emptySet()); + }); +``` + +Configuring any field activates the Data Collection defaults for omitted fields. Operation metadata used for tracing and grouping can still be collected when document or variable content is disabled. + ## Capture Tracing Information To be able to capture transactions, you have to first set up tracing. diff --git a/docs/platforms/java/common/integrations/graphql22.mdx b/docs/platforms/java/common/integrations/graphql22.mdx index 447ad0314441bb..787ebec0cf0355 100644 --- a/docs/platforms/java/common/integrations/graphql22.mdx +++ b/docs/platforms/java/common/integrations/graphql22.mdx @@ -114,6 +114,24 @@ The `SentryDataFetcherExceptionHandler` has been deprecated. Please upgrade to ` +## Control GraphQL Content + +GraphQL documents, variables, and supported request and response bodies can contain sensitive application data. Use Data Collection to control them independently: + +```java +import io.sentry.Sentry; +import java.util.Collections; + +Sentry.init( + options -> { + options.getDataCollection().getGraphql().setDocument(false); + options.getDataCollection().getGraphql().setVariables(false); + options.getDataCollection().setHttpBodies(Collections.emptySet()); + }); +``` + +Configuring any field activates the Data Collection defaults for omitted fields. Operation metadata used for tracing and grouping can still be collected when document or variable content is disabled. + ## Capture Tracing Information To be able to capture transactions, you have to first set up tracing. diff --git a/docs/platforms/java/common/tracing/instrumentation/apollo3.mdx b/docs/platforms/java/common/tracing/instrumentation/apollo3.mdx index 6140ed32eace58..f9dbaf9dd4ad43 100644 --- a/docs/platforms/java/common/tracing/instrumentation/apollo3.mdx +++ b/docs/platforms/java/common/tracing/instrumentation/apollo3.mdx @@ -216,17 +216,18 @@ val apollo = ApolloClient.builder() .build() ``` -By default, error events won't contain `Headers` or `Cookies`, but you can change this behavior by setting the `sendDefaultPii` option to `true`: +Use Data Collection to control headers, cookies, URL query parameters, request and response bodies, GraphQL documents, and GraphQL variables. For example, disable GraphQL variables and all HTTP body collection: ```kotlin +import io.sentry.Sentry + Sentry.init { options -> - options.isSendDefaultPii = true + options.dataCollection.graphql.variables = false + options.dataCollection.httpBodies = emptySet() } ``` -Error events will contain the raw bodies of GraphQL requests and responses, which may include sensitive data. To avoid this, parameterize your queries using the [variables](https://spec.graphql.org/October2021/#sec-Language.Variables) field. [Relay](/product/relay) will then run [PII Data Scrubbing](/product/relay/#pii-data-scrubbing), automatically transforming values into `[Filtered]`. - -Alternatively, you can customize the event and scrub the data yourself. +Configuring either field activates the Data Collection defaults for omitted fields. GraphQL request and response bodies may contain sensitive data, so review both `graphql` and `httpBodies` before enabling them. You can also customize the event and scrub application-specific data yourself. ### Customize or Drop the Error Event diff --git a/docs/platforms/java/common/tracing/instrumentation/apollo4.mdx b/docs/platforms/java/common/tracing/instrumentation/apollo4.mdx index f379c4588da1fb..2bee804c01cdc4 100644 --- a/docs/platforms/java/common/tracing/instrumentation/apollo4.mdx +++ b/docs/platforms/java/common/tracing/instrumentation/apollo4.mdx @@ -193,17 +193,18 @@ val apollo = ApolloClient.builder() .build() ``` -By default, error events won't contain `Headers` or `Cookies`, but you can change this behavior by setting the `sendDefaultPii` option to `true`: +Use Data Collection to control headers, cookies, URL query parameters, request and response bodies, GraphQL documents, and GraphQL variables. For example, disable GraphQL variables and all HTTP body collection: ```kotlin +import io.sentry.Sentry + Sentry.init { options -> - options.isSendDefaultPii = true + options.dataCollection.graphql.variables = false + options.dataCollection.httpBodies = emptySet() } ``` -Error events will contain the raw bodies of GraphQL requests and responses, which may include sensitive data. To avoid this, parameterize your queries using the [variables](https://spec.graphql.org/October2021/#sec-Language.Variables) field. [Relay](/product/relay) will then run [PII Data Scrubbing](/product/relay/#pii-data-scrubbing), automatically transforming values into `[Filtered]`. - -Alternatively, you can customize the event and scrub the data yourself. +Configuring either field activates the Data Collection defaults for omitted fields. GraphQL request and response bodies may contain sensitive data, so review both `graphql` and `httpBodies` before enabling them. You can also customize the event and scrub application-specific data yourself. ### Customize or Drop the Error Event diff --git a/docs/platforms/java/common/tracing/instrumentation/ktor-client.mdx b/docs/platforms/java/common/tracing/instrumentation/ktor-client.mdx index fc08b57cac482d..d94a852e5d1948 100644 --- a/docs/platforms/java/common/tracing/instrumentation/ktor-client.mdx +++ b/docs/platforms/java/common/tracing/instrumentation/ktor-client.mdx @@ -142,14 +142,21 @@ val ktorClient = HttpClient(Java) { } ``` -By default, error events won't contain any PII data, such as `Headers` and `Cookies`, but you can change this behavior by setting the `sendDefaultPii` option to `true`: +Use Data Collection to control the request and response headers, cookies, and URL query parameters attached to error events. For example, allow selected request headers and omit cookies: ```kotlin +import io.sentry.KeyValueCollectionBehavior +import io.sentry.Sentry + Sentry.init { options -> - options.isSendDefaultPii = true + options.dataCollection.httpHeaders.request = + KeyValueCollectionBehavior.allowList("content-type", "x-request-id") + options.dataCollection.cookies = KeyValueCollectionBehavior.off() } ``` +Configuring either field activates the Data Collection defaults for omitted fields. Sensitive values still use the built-in filtering rules. + Those events are searchable and you can set alerts on them if you use the `http.url` and `http.status_code` properties. Learn more in our full [Searchable Properties](/concepts/search/searchable-properties/) documentation. ### Customize or Drop the Error Event diff --git a/docs/platforms/java/common/tracing/instrumentation/okhttp.mdx b/docs/platforms/java/common/tracing/instrumentation/okhttp.mdx index a0b582b457a091..aea6f2b70f048a 100644 --- a/docs/platforms/java/common/tracing/instrumentation/okhttp.mdx +++ b/docs/platforms/java/common/tracing/instrumentation/okhttp.mdx @@ -259,14 +259,21 @@ private val client = OkHttpClient.Builder() .build() ``` -By default, error events won't contain any PII data, such as `Headers` and `Cookies`, but you can change this behavior by setting the `sendDefaultPii` option to `true`: +Use Data Collection to control the request and response headers, cookies, and URL query parameters attached to error events. For example, allow selected request headers and omit cookies: ```kotlin +import io.sentry.KeyValueCollectionBehavior +import io.sentry.Sentry + Sentry.init { options -> - options.isSendDefaultPii = true + options.dataCollection.httpHeaders.request = + KeyValueCollectionBehavior.allowList("content-type", "x-request-id") + options.dataCollection.cookies = KeyValueCollectionBehavior.off() } ``` +Configuring either field activates the Data Collection defaults for omitted fields. Sensitive values still use the built-in filtering rules. + HTTP client errors sent to Sentry are searchable and you can set alerts on them if you use the `http.url` and `http.status_code` properties. Learn more in our full [Searchable Properties](/concepts/search/searchable-properties/) documentation. ### Customize or Drop the Error Event diff --git a/docs/platforms/java/common/tracing/instrumentation/open-feign.mdx b/docs/platforms/java/common/tracing/instrumentation/open-feign.mdx index 447d2e0f8735a3..546daab1592705 100644 --- a/docs/platforms/java/common/tracing/instrumentation/open-feign.mdx +++ b/docs/platforms/java/common/tracing/instrumentation/open-feign.mdx @@ -61,6 +61,23 @@ val api = Feign.builder() .target(YourApi::class.java, "https://your-api-host/") ``` +## Control URL Query Parameters + +OpenFeign adds URLs to HTTP spans and breadcrumbs. Use `dataCollection.urlQueryParams` to filter or omit their query parameters: + +```java +import io.sentry.KeyValueCollectionBehavior; +import io.sentry.Sentry; + +Sentry.init( + options -> + options + .getDataCollection() + .setUrlQueryParams(KeyValueCollectionBehavior.off())); +``` + +Configuring this field activates the Data Collection defaults for omitted fields. The base URL is still sent when query parameter collection is disabled. + ## Modify or Drop Spans Spans created around HTTP requests can be modified or dropped using `SentryFeignClient.BeforeSpanCallback` passed to `SentryCapability`: diff --git a/docs/platforms/java/guides/spring-boot/logging-frameworks/logback.mdx b/docs/platforms/java/guides/spring-boot/logging-frameworks/logback.mdx index cb049a777b9029..273979e2b298ab 100644 --- a/docs/platforms/java/guides/spring-boot/logging-frameworks/logback.mdx +++ b/docs/platforms/java/guides/spring-boot/logging-frameworks/logback.mdx @@ -88,6 +88,10 @@ However, if errors that may appear during startup should to be sent to Sentry, t +### Encoded Messages + +When a custom `SentryAppender` uses an encoder, Sentry sends the encoded message and omits the original message template and parameters by default. Set `true` directly on the appender to include them without enabling the broader `sendDefaultPii` option. See the [Logback configuration example](/platforms/java/guides/logback/#encoded-messages). + ## Mapped Diagnostic Context (MDC) Starting with Sentry Java SDK version 8.24.0, you can use the `contextTags` option to include specific properties from the Mapped Diagnostic Context (MDC) as attributes on log entries sent to Sentry. diff --git a/docs/platforms/java/guides/spring-boot/record-user.mdx b/docs/platforms/java/guides/spring-boot/record-user.mdx index bd59516f8ac092..71c584c9aee7e6 100644 --- a/docs/platforms/java/guides/spring-boot/record-user.mdx +++ b/docs/platforms/java/guides/spring-boot/record-user.mdx @@ -13,17 +13,20 @@ Record user information from an HTTP request or by registering a Spring bean for ## Recording User Information From HTTP Request -To record the user's IP address and `Principal#name` as the username, set the personal information flag to `true`. +To record the user's IP address and `Principal#name` as the username, enable automatic user information through Data Collection: ```properties {tabTitle:application.properties} -sentry.send-default-pii=true +sentry.data-collection.user-info=true ``` ```yaml {tabTitle:application.yml} sentry: - send-default-pii: true + data-collection: + user-info: true ``` +Configuring this field activates the Data Collection defaults for omitted fields. + ## Recording Custom User Information To record custom user information, you can register a bean that implements `SentryUserProvider` interface. diff --git a/docs/platforms/java/guides/spring/advanced-usage.mdx b/docs/platforms/java/guides/spring/advanced-usage.mdx index 4dfb686404225f..9b0117afbae0f8 100644 --- a/docs/platforms/java/guides/spring/advanced-usage.mdx +++ b/docs/platforms/java/guides/spring/advanced-usage.mdx @@ -9,67 +9,15 @@ Record user information from an HTTP request or by registering a Spring bean for ## Recording User Information From HTTP Request -To record the user's IP address and `Principal#name` as the username so you can then view in [trace view](/concepts/key-terms/tracing/trace-view/): +To record the user's IP address and `Principal#name` as the username so you can view it in [Trace View](/concepts/key-terms/tracing/trace-view/): -1. Set the personal information flag on `@EnableSentry` to `true`. +1. Enable automatic user information in `sentry.properties`: - -```Java {tabTitle:Java (Spring 5)} {mdExpandTabs} -import org.springframework.context.annotation.Configuration; -import io.sentry.spring.EnableSentry; - -@EnableSentry(dsn = "___PUBLIC_DSN___", sendDefaultPii = true) -@Configuration -class SentryConfiguration { -} -``` - -```Java {tabTitle:Java (Spring 6)} -import org.springframework.context.annotation.Configuration; -import io.sentry.spring.jakarta.EnableSentry; - -@EnableSentry(dsn = "___PUBLIC_DSN___", sendDefaultPii = true) -@Configuration -class SentryConfiguration { -} -``` - -```Java {tabTitle:Java (Spring 7)} -import org.springframework.context.annotation.Configuration; -import io.sentry.spring7.EnableSentry; - -@EnableSentry(dsn = "___PUBLIC_DSN___", sendDefaultPii = true) -@Configuration -class SentryConfiguration { -} +```properties {filename:sentry.properties} +data-collection.user-info=true ``` -```kotlin {tabTitle:Kotlin (Spring 5)} -import org.springframework.context.annotation.Configuration -import io.sentry.spring.EnableSentry - -@EnableSentry(dsn = "...", sendDefaultPii = true) -@Configuration -class SentryConfiguration -``` - -```kotlin {tabTitle:Kotlin (Spring 6)} -import org.springframework.context.annotation.Configuration -import io.sentry.spring.jakarta.EnableSentry - -@EnableSentry(dsn = "...", sendDefaultPii = true) -@Configuration -class SentryConfiguration -``` - -```kotlin {tabTitle:Kotlin (Spring 7)} -import org.springframework.context.annotation.Configuration -import io.sentry.spring7.EnableSentry - -@EnableSentry(dsn = "...", sendDefaultPii = true) -@Configuration -class SentryConfiguration -``` +Configuring this field activates the Data Collection defaults for omitted fields. The `@EnableSentry` annotation enables external configuration automatically. 2. Register the servlet filter bean `SentryUserFilter`: diff --git a/platform-includes/getting-started-config/java.jul.mdx b/platform-includes/getting-started-config/java.jul.mdx index 40bdc1d56e638f..b9fa7348381f38 100644 --- a/platform-includes/getting-started-config/java.jul.mdx +++ b/platform-includes/getting-started-config/java.jul.mdx @@ -35,9 +35,10 @@ Sentry reads the DSN from the system property `sentry.dsn`, environment variable ```properties {tabTitle:sentry.properties} dsn=___PUBLIC_DSN___ -# Add data like request headers and IP for users, -# see https://docs.sentry.io/platforms/java/guides/jul/data-management/data-collected/ for more info -send-default-pii=true +# Use Data Collection defaults but don't collect automatic user information. +# https://docs.sentry.io/platforms/java/guides/jul/data-management/data-collected/ +data-collection.user-info=false +# Configure other data categories here. # Enable logs logs.enabled=true diff --git a/platform-includes/getting-started-config/java.log4j2.mdx b/platform-includes/getting-started-config/java.log4j2.mdx index ad63de687fce74..21571683b485ff 100644 --- a/platform-includes/getting-started-config/java.log4j2.mdx +++ b/platform-includes/getting-started-config/java.log4j2.mdx @@ -68,9 +68,10 @@ Note that **you need to configure your DSN** (client key) only if you wish to in If the DSN is not present in the `log4j2.xml` configuration, Sentry will attempt to read it from the system property `sentry.dsn`, environment variable `SENTRY_DSN` or the `dsn` property in `sentry.properties` file. [See the configuration page](/platforms/java/configuration/) for more details on external configuration. ```properties {tabTitle:sentry.properties} -# Add data like request headers and IP for users, -# see https://docs.sentry.io/platforms/java/guides/log4j2/data-management/data-collected/ for more info -send-default-pii=true +# Use Data Collection defaults but don't collect automatic user information. +# https://docs.sentry.io/platforms/java/guides/log4j2/data-management/data-collected/ +data-collection.user-info=false +# Configure other data categories here. // ___PRODUCT_OPTION_START___ logs logs.enabled=true // ___PRODUCT_OPTION_END___ logs diff --git a/platform-includes/getting-started-config/java.logback.mdx b/platform-includes/getting-started-config/java.logback.mdx index 1fdfe1b3dc621a..c68dff686d8761 100644 --- a/platform-includes/getting-started-config/java.logback.mdx +++ b/platform-includes/getting-started-config/java.logback.mdx @@ -21,10 +21,6 @@ The `ConsoleAppender` is provided only as an example of a non-Sentry appender se - - ___PUBLIC_DSN___ - - true // ___PRODUCT_OPTION_START___ logs true @@ -67,23 +63,19 @@ The `ConsoleAppender` is provided only as an example of a non-Sentry appender se -### DSN Configuration +### SDK Configuration -Note that **you need to configure your DSN** (client key). +Configure the SDK using a `sentry.properties` file: - -```xml - - - - ___PUBLIC_DSN___ - - true - - +```properties {filename:sentry.properties} +dsn=___PUBLIC_DSN___ +# Use Data Collection defaults but don't collect automatic user information. +# https://docs.sentry.io/platforms/java/guides/logback/data-management/data-collected/ +data-collection.user-info=false +# Configure other data categories here. ``` -If the DSN is not present in the `logback.xml` configuration, Sentry will attempt to read it from the system property `sentry.dsn`, environment variable `SENTRY_DSN` or the `dsn` property in `sentry.properties` file. [See the configuration page](/platforms/java/configuration/) for more details on external configuration. +You can also provide the DSN through the `sentry.dsn` system property or the `SENTRY_DSN` environment variable. [See the configuration page](/platforms/java/configuration/) for more details on external configuration. ### Minimum Log Level @@ -108,12 +100,6 @@ Breadcrumbs are kept in memory (by default the last 100 records) and are sent wi ```xml - - - ___PUBLIC_DSN___ - - true - WARN @@ -140,3 +126,20 @@ Breadcrumbs are kept in memory (by default the last 100 records) and are sent wi ``` + +### Encoded Messages + +A Logback encoder can mask or remove sensitive values before Sentry receives a log entry. When you configure an encoder on `SentryAppender`, Sentry sends the encoded message and omits the original message template and parameters by default. + +Set `includeUnencodedMessage` to `true` when you also need the original template and parameters: + +```xml {filename:logback.xml} + + + %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n + + true + +``` + +Original templates and parameters can contain sensitive data. Prefer this scoped appender option to `sendDefaultPii`; the legacy `sendDefaultPii=true` behavior remains supported for compatibility. diff --git a/platform-includes/getting-started-config/java.mdx b/platform-includes/getting-started-config/java.mdx index 3ab8bbd95cbeda..a1d29626755d00 100644 --- a/platform-includes/getting-started-config/java.mdx +++ b/platform-includes/getting-started-config/java.mdx @@ -2,14 +2,18 @@ Configuration should happen as early as possible in your application's lifecycle. ```java {tabTitle: Java} +import io.sentry.DataCollection; import io.sentry.Sentry; Sentry.init(options -> { options.setDsn("___PUBLIC_DSN___"); - // Add data like request headers and IP for users, - // see https://docs.sentry.io/platforms/java/data-management/data-collected/ for more info - options.setSendDefaultPii(true); + // Use Data Collection defaults but don't collect automatic user information. + // https://docs.sentry.io/platforms/java/data-management/data-collected/ + DataCollection dataCollection = new DataCollection(); + dataCollection.setUserInfo(false); + // Configure other data categories here. + options.setDataCollection(dataCollection); // ___PRODUCT_OPTION_START___ performance // Set traces_sample_rate to 1.0 to capture 100% @@ -32,14 +36,18 @@ Sentry.init(options -> { ``` ```kotlin {tabTitle: Kotlin} +import io.sentry.DataCollection import io.sentry.Sentry Sentry.init { options -> options.dsn = "___PUBLIC_DSN___" - // Add data like request headers and IP for users, - // see https://docs.sentry.io/platforms/java/data-management/data-collected/ for more info - options.isSendDefaultPii = true + // Use Data Collection defaults but don't collect automatic user information. + // https://docs.sentry.io/platforms/java/data-management/data-collected/ + options.dataCollection = DataCollection().apply { + userInfo = false + // Configure other data categories here. + } // ___PRODUCT_OPTION_START___ performance // Set traces_sample_rate to 1.0 to capture 100% diff --git a/platform-includes/getting-started-config/java.servlet.mdx b/platform-includes/getting-started-config/java.servlet.mdx index d881ae1dcc8e2b..826e73dfa92324 100644 --- a/platform-includes/getting-started-config/java.servlet.mdx +++ b/platform-includes/getting-started-config/java.servlet.mdx @@ -7,6 +7,7 @@ The following example configures a `SentryInitializer` servlet container initial ```java package sentry.sample; +import io.sentry.DataCollection; import io.sentry.Sentry; import javax.servlet.ServletContainerInitializer; import javax.servlet.ServletContext; @@ -19,9 +20,12 @@ public final class SentryInitializer implements ServletContainerInitializer { Sentry.init(options -> { options.setDsn("___PUBLIC_DSN___"); - // Add data like request headers and IP for users, - // see https://docs.sentry.io/platforms/java/guides/servlet/data-management/data-collected/ for more info - options.setSendDefaultPii(true); + // Use Data Collection defaults but don't collect automatic user information. + // https://docs.sentry.io/platforms/java/guides/servlet/data-management/data-collected/ + DataCollection dataCollection = new DataCollection(); + dataCollection.setUserInfo(false); + // Configure other data categories here. + options.setDataCollection(dataCollection); // ___PRODUCT_OPTION_START___ performance // Set traces_sample_rate to 1.0 to capture 100% @@ -48,6 +52,7 @@ public final class SentryInitializer implements ServletContainerInitializer { ```kotlin package sentry.sample; +import io.sentry.DataCollection import javax.servlet.ServletContainerInitializer import javax.servlet.ServletContext import javax.servlet.ServletException @@ -58,9 +63,12 @@ class SentryInitializer : ServletContainerInitializer { Sentry.init { options -> options.dsn = "___PUBLIC_DSN___" - // Add data like request headers and IP for users, - // see https://docs.sentry.io/platforms/java/guides/servlet/data-management/data-collected/ for more info - options.isSendDefaultPii = true + // Use Data Collection defaults but don't collect automatic user information. + // https://docs.sentry.io/platforms/java/guides/servlet/data-management/data-collected/ + options.dataCollection = DataCollection().apply { + userInfo = false + // Configure other data categories here. + } // ___PRODUCT_OPTION_START___ performance // Set traces_sample_rate to 1.0 to capture 100% diff --git a/platform-includes/getting-started-config/java.spring-boot.mdx b/platform-includes/getting-started-config/java.spring-boot.mdx index bacb025bc1908a..83df69f0e8d542 100644 --- a/platform-includes/getting-started-config/java.spring-boot.mdx +++ b/platform-includes/getting-started-config/java.spring-boot.mdx @@ -6,9 +6,10 @@ Provide a `sentry.dsn` property using either `application.properties` or `applic ```properties {filename:application.properties} sentry.dsn=___PUBLIC_DSN___ -# Add data like request headers and IP for users, -# see https://docs.sentry.io/platforms/java/guides/spring-boot/data-management/data-collected/ for more info -sentry.send-default-pii=true +# Use Data Collection defaults but don't collect automatic user information. +# https://docs.sentry.io/platforms/java/guides/spring-boot/data-management/data-collected/ +sentry.data-collection.user-info=false +# Configure other data categories here. # ___PRODUCT_OPTION_START___ performance # Set traces_sample_rate to 1.0 to capture 100% @@ -33,9 +34,11 @@ sentry.logs.enabled=true sentry: dsn: ___PUBLIC_DSN___ - # Add data like request headers and IP for users, - # see https://docs.sentry.io/platforms/java/guides/spring-boot/data-management/data-collected/ for more info - send-default-pii: true + # Use Data Collection defaults but don't collect automatic user information. + # https://docs.sentry.io/platforms/java/guides/spring-boot/data-management/data-collected/ + data-collection: + user-info: false + # Configure other data categories here. # ___PRODUCT_OPTION_START___ performance # Set traces_sample_rate to 1.0 to capture 100% diff --git a/platform-includes/getting-started-config/java.spring.mdx b/platform-includes/getting-started-config/java.spring.mdx index 0e2ef7fd72251f..b0682f6a21e837 100644 --- a/platform-includes/getting-started-config/java.spring.mdx +++ b/platform-includes/getting-started-config/java.spring.mdx @@ -8,10 +8,7 @@ import io.sentry.spring.EnableSentry; // NOTE: Replace the test DSN below with YOUR OWN DSN to see the events from this app in your Sentry // project/dashboard @EnableSentry( - dsn = "___PUBLIC_DSN___", - // Add data like request headers and IP for users, - // see https://docs.sentry.io/platforms/java/guides/spring/data-management/data-collected/ for more info - sendDefaultPii = true + dsn = "___PUBLIC_DSN___" ) @Configuration class SentryConfiguration { @@ -23,10 +20,7 @@ import io.sentry.spring.jakarta.EnableSentry; // NOTE: Replace the test DSN below with YOUR OWN DSN to see the events from this app in your Sentry // project/dashboard @EnableSentry( - dsn = "___PUBLIC_DSN___", - // Add data like request headers and IP for users, - // see https://docs.sentry.io/platforms/java/guides/spring/data-management/data-collected/ for more info - sendDefaultPii = true + dsn = "___PUBLIC_DSN___" ) @Configuration class SentryConfiguration { @@ -38,10 +32,7 @@ import io.sentry.spring7.EnableSentry; // NOTE: Replace the test DSN below with YOUR OWN DSN to see the events from this app in your Sentry // project/dashboard @EnableSentry( - dsn = "___PUBLIC_DSN___", - // Add data like request headers and IP for users, - // see https://docs.sentry.io/platforms/java/guides/spring/data-management/data-collected/ for more info - sendDefaultPii = true + dsn = "___PUBLIC_DSN___" ) @Configuration class SentryConfiguration { @@ -53,10 +44,7 @@ import io.sentry.spring.EnableSentry // NOTE: Replace the test DSN below with YOUR OWN DSN to see the events from this app in your Sentry // project/dashboard @EnableSentry( - dsn = "___PUBLIC_DSN___", - // Add data like request headers and IP for users, - // see https://docs.sentry.io/platforms/java/guides/spring/data-management/data-collected/ for more info - sendDefaultPii = true + dsn = "___PUBLIC_DSN___" ) @Configuration class SentryConfiguration @@ -67,10 +55,7 @@ import io.sentry.spring.jakarta.EnableSentry // NOTE: Replace the test DSN below with YOUR OWN DSN to see the events from this app in your Sentry // project/dashboard @EnableSentry( - dsn = "___PUBLIC_DSN___", - // Add data like request headers and IP for users, - // see https://docs.sentry.io/platforms/java/guides/spring/data-management/data-collected/ for more info - sendDefaultPii = true + dsn = "___PUBLIC_DSN___" ) @Configuration class SentryConfiguration @@ -81,15 +66,20 @@ import io.sentry.spring7.EnableSentry // NOTE: Replace the test DSN below with YOUR OWN DSN to see the events from this app in your Sentry // project/dashboard @EnableSentry( - dsn = "___PUBLIC_DSN___", - // Add data like request headers and IP for users, - // see https://docs.sentry.io/platforms/java/guides/spring/data-management/data-collected/ for more info - sendDefaultPii = true + dsn = "___PUBLIC_DSN___" ) @Configuration class SentryConfiguration ``` +Configure Data Collection in `sentry.properties`. Setting any Data Collection field applies its defaults to omitted fields: + +```properties {filename:sentry.properties} +# Use Data Collection defaults but don't collect automatic user information. +data-collection.user-info=false +# Configure other data categories here. +``` + The DSN can be also provided through the system property `sentry.dsn`, environment variable `SENTRY_DSN` or the `dsn` property in `sentry.properties` file. [See the configuration page](/platforms/java/configuration/) for more details on external configuration. Once this integration is configured you can _also_ use Sentry’s static API, [as shown on the usage page](usage/), to record breadcrumbs, set the current user, or manually send events, for example. @@ -104,9 +94,6 @@ import org.springframework.core.Ordered; // project/dashboard @EnableSentry( dsn = "___PUBLIC_DSN___", - // Add data like request headers and IP for users, - // see https://docs.sentry.io/platforms/java/guides/spring/data-management/data-collected/ for more info - sendDefaultPii = true, exceptionResolverOrder = Ordered.LOWEST_PRECEDENCE ) class SentryConfiguration { @@ -120,9 +107,6 @@ import org.springframework.core.Ordered; // project/dashboard @EnableSentry( dsn = "___PUBLIC_DSN___", - // Add data like request headers and IP for users, - // see https://docs.sentry.io/platforms/java/guides/spring/data-management/data-collected/ for more info - sendDefaultPii = true, exceptionResolverOrder = Ordered.LOWEST_PRECEDENCE ) class SentryConfiguration { @@ -136,9 +120,6 @@ import org.springframework.core.Ordered; // project/dashboard @EnableSentry( dsn = "___PUBLIC_DSN___", - // Add data like request headers and IP for users, - // see https://docs.sentry.io/platforms/java/guides/spring/data-management/data-collected/ for more info - sendDefaultPii = true, exceptionResolverOrder = Ordered.LOWEST_PRECEDENCE ) class SentryConfiguration { @@ -152,9 +133,6 @@ import org.springframework.core.Ordered // project/dashboard @EnableSentry( dsn = "___PUBLIC_DSN___", - // Add data like request headers and IP for users, - // see https://docs.sentry.io/platforms/java/guides/spring/data-management/data-collected/ for more info - sendDefaultPii = true, exceptionResolverOrder = Ordered.LOWEST_PRECEDENCE ) class SentryConfiguration @@ -167,9 +145,6 @@ import org.springframework.core.Ordered // project/dashboard @EnableSentry( dsn = "___PUBLIC_DSN___", - // Add data like request headers and IP for users, - // see https://docs.sentry.io/platforms/java/guides/spring/data-management/data-collected/ for more info - sendDefaultPii = true, exceptionResolverOrder = Ordered.LOWEST_PRECEDENCE ) class SentryConfiguration @@ -182,9 +157,6 @@ import org.springframework.core.Ordered // project/dashboard @EnableSentry( dsn = "___PUBLIC_DSN___", - // Add data like request headers and IP for users, - // see https://docs.sentry.io/platforms/java/guides/spring/data-management/data-collected/ for more info - sendDefaultPii = true, exceptionResolverOrder = Ordered.LOWEST_PRECEDENCE ) class SentryConfiguration diff --git a/platform-includes/getting-started-config/opentelemetry/java.mdx b/platform-includes/getting-started-config/opentelemetry/java.mdx index a3d2c434bc21aa..083b36ef8c2eb7 100644 --- a/platform-includes/getting-started-config/opentelemetry/java.mdx +++ b/platform-includes/getting-started-config/opentelemetry/java.mdx @@ -4,9 +4,10 @@ The SDK can be configured using a `sentry.properties` file: ```properties {filename:sentry.properties} dsn=___PUBLIC_DSN___ -# Add data like request headers and IP for users, -# see https://docs.sentry.io/platforms/java/data-management/data-collected/ for more info -send-default-pii=true +# Use Data Collection defaults but don't collect automatic user information. +# https://docs.sentry.io/platforms/java/data-management/data-collected/ +data-collection.user-info=false +# Configure other data categories here. # ___PRODUCT_OPTION_START___ performance traces-sample-rate=1.0 # ___PRODUCT_OPTION_END___ performance