Skip to content

Commit d5cd117

Browse files
authored
feat(dart & flutter): add data collected page and sendDefaultPii to getting started (#12787)
* Update index.mdx * add sendDefaultPii to getting started * formatting * use platformlink in dart data-collected page * Update data-collected.mdx * update denylist link * Update sentry_dart_plugin link * Fix grammar
1 parent ed80a0c commit d5cd117

File tree

6 files changed

+184
-0
lines changed

6 files changed

+184
-0
lines changed

docs/platforms/dart/configuration/options.mdx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,17 @@ _(New in version 7.0.0)_
149149

150150
</ConfigKey>
151151

152+
<ConfigKey name="max-request-body-size">
153+
154+
This parameter controls whether integrations should capture HTTP request bodies. It can be set to one of the following values:
155+
156+
- `never`: Request bodies are never sent.
157+
- `small`: Only small request bodies will be captured. The cutoff for small depends on the SDK (typically 4KB).
158+
- `medium`: Medium and small requests will be captured (typically 10KB).
159+
- `always`: The SDK will always capture the request body as long as Sentry can make sense of it.
160+
161+
</ConfigKey>
162+
152163
## Integration Configuration
153164

154165
For many platform SDKs integrations can be configured alongside it. On some platforms that happen as part of the `init()` call, in some others, different patterns apply.
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
---
2+
title: Data Collected
3+
description: "See what data is collected by the Sentry SDK."
4+
sidebar_order: 1
5+
---
6+
7+
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.
8+
9+
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 Dart SDK collects.
10+
11+
Many of the categories listed here require you to enable the <PlatformLink to="/configuration/options/#send-default-pii">sendDefaultPii option</PlatformLink>.
12+
13+
## HTTP Headers
14+
15+
By default, the Sentry SDK doesn't send any HTTP headers. Even when sending HTTP headers is enabled, we have a [denylist](https://github.com/getsentry/sentry-dart/blob/ea1d45d64f52551e2e033c50b0ff8512e3d8a4e3/dart/lib/src/utils/http_sanitizer.dart#L9C1-L21C1) in place, which filters out any headers that contain sensitive data.
16+
17+
To start sending HTTP headers, set <PlatformLink to="/configuration/options/#send-default-pii">`sendDefaultPii = true`</PlatformLink>.
18+
19+
## Information About Logged-in User
20+
21+
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.
22+
23+
To start sending logged-in user information, set <PlatformLink to="/configuration/options/#send-default-pii">`sendDefaultPii = true`</PlatformLink>.
24+
25+
## Users' IP Addresses
26+
27+
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.
28+
29+
To enable sending the user's IP address, set <PlatformLink to="/configuration/options/#send-default-pii">`sendDefaultPii = true`</PlatformLink>.
30+
31+
## Request URL
32+
33+
The full request URL of outgoing and incoming HTTP requests is **always sent to Sentry**. Depending on your application, this could contain PII data.
34+
35+
## Request Query String
36+
37+
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.
38+
39+
## Request Body
40+
41+
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:
42+
43+
- **The type of the request body:**
44+
- JSON and form bodies are sent
45+
- **The size of the request body:** There's a <PlatformLink to="/configuration/options/#max-request-body-size">maxRequestBodySize</PlatformLink> option that's set to `NONE` by default. This means by default no request body is sent to Sentry.
46+
47+
## File I/O
48+
49+
By default the Sentry SDK does not send the name or path of files when <PlatformLink to="/integrations/file">instrumenting File I/O</PlatformLink>.
50+
51+
If you want to send file names and paths, set <PlatformLink to="/configuration/options/#send-default-pii">`sendDefaultPii = true`</PlatformLink>.
52+
53+
## Runtime Information
54+
55+
By default, the SDK collects basic runtime information like the Dart version and platform.
56+
57+
When <PlatformLink to="/configuration/options/#send-default-pii">`sendDefaultPii = true`</PlatformLink>, additional runtime details are collected:
58+
- Executable path e.g `dart`
59+
- Resolved executable locations e.g `/system/bin/app_process64`
60+
- Script path e.g `file:///main.dart`
61+
62+
## SQL Queries
63+
64+
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.

docs/platforms/dart/index.mdx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ Future<void> main() async {
5353
// Set tracesSampleRate to 1.0 to capture 100% of transactions for tracing.
5454
// We recommend adjusting this value in production.
5555
options.tracesSampleRate = 1.0;
56+
// Adds request headers and IP for users,
57+
// visit: https://docs.sentry.io/platforms/dart/data-management/data-collected/ for more info
58+
options.sendDefaultPii = true;
5659
});
5760

5861
// you can also configure SENTRY_DSN, SENTRY_RELEASE, SENTRY_DIST, and

docs/platforms/flutter/configuration/options.mdx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,17 @@ _(New in version 7.0.0)_
190190

191191
</ConfigKey>
192192

193+
<ConfigKey name="max-request-body-size">
194+
195+
This parameter controls whether integrations should capture HTTP request bodies. It can be set to one of the following values:
196+
197+
- `never`: Request bodies are never sent.
198+
- `small`: Only small request bodies will be captured. The cutoff for small depends on the SDK (typically 4KB).
199+
- `medium`: Medium and small requests will be captured (typically 10KB).
200+
- `always`: The SDK will always capture the request body as long as Sentry can make sense of it.
201+
202+
</ConfigKey>
203+
193204
## Integration Configuration
194205

195206
For many platform SDKs integrations can be configured alongside it. On some platforms that happen as part of the `init()` call, in some others, different patterns apply.
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
---
2+
title: Data Collected
3+
description: "See what data is collected by the Sentry SDK."
4+
sidebar_order: 1
5+
---
6+
7+
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.
8+
9+
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 Flutter SDK collects.
10+
11+
Many of the categories listed here require you to enable the <PlatformLink to="/configuration/options/#send-default-pii">sendDefaultPii option</PlatformLink>.
12+
13+
## HTTP Headers
14+
15+
By default, the Sentry SDK doesn't send any HTTP headers. Even when sending HTTP headers is enabled, we have a [denylist](https://github.com/getsentry/sentry-dart/blob/ea1d45d64f52551e2e033c50b0ff8512e3d8a4e3/dart/lib/src/utils/http_sanitizer.dart#L9C1-L21C1) in place, which filters out any headers that contain sensitive data.
16+
17+
To start sending HTTP headers, set <PlatformLink to="/configuration/options/#send-default-pii">`sendDefaultPii = true`</PlatformLink>.
18+
19+
## Information About Logged-in User
20+
21+
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.
22+
23+
To start sending logged-in user information, set <PlatformLink to="/configuration/options/#send-default-pii">`sendDefaultPii = true`</PlatformLink>.
24+
25+
## Users' IP Addresses
26+
27+
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.
28+
29+
To enable sending the user's IP address, set <PlatformLink to="/configuration/options/#send-default-pii">`sendDefaultPii = true`</PlatformLink>.
30+
31+
## Request URL
32+
33+
The full request URL of outgoing and incoming HTTP requests is **always sent to Sentry**. Depending on your application, this could contain PII data.
34+
35+
## Request Query String
36+
37+
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.
38+
39+
## Request Body
40+
41+
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:
42+
43+
- **The type of the request body:**
44+
- JSON and form bodies are sent
45+
- **The size of the request body:** There's a <PlatformLink to="/configuration/options/#max-request-body-size">maxRequestBodySize</PlatformLink> option that's set to `NONE` by default. This means by default no request body is sent to Sentry.
46+
47+
## Source Context
48+
49+
Our tool [sentry_dart_plugin](https://pub.dev/packages/sentry_dart_plugin) can upload your source code to Sentry, which can be used to show the lines of code where an error happened in the Issue Details page.
50+
51+
To opt into sending this source context to Sentry, you have to enable the feature as described in <PlatformLink to="/upload-debug/#source-context">the Source Context documentation</PlatformLink>.
52+
53+
## File I/O
54+
55+
By default the Sentry SDK does not send the name or path of files when [instrumenting File I/O](/platforms/dart/integrations/file/).
56+
57+
If you want to send file names and paths, set <PlatformLink to="/configuration/options/#send-default-pii">`sendDefaultPii = true`</PlatformLink>.
58+
59+
## Device Information
60+
61+
By default the Sentry SDK does not send the name of the device.
62+
63+
If you want to send the device name, set <PlatformLink to="/configuration/options/#send-default-pii">`sendDefaultPii = true`</PlatformLink>.
64+
65+
## Runtime Information
66+
67+
By default, the SDK collects basic runtime information like the Dart version and platform.
68+
69+
When <PlatformLink to="/configuration/options/#send-default-pii">`sendDefaultPii = true`</PlatformLink>, additional runtime details are collected:
70+
- Executable path e.g `flutter`
71+
- Resolved executable locations e.g `/system/bin/app_process64`
72+
- Script path e.g `file:///main.dart`
73+
74+
## SQL Queries
75+
76+
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.
77+
78+
## User Interaction Data
79+
80+
By default, the SDK collects basic UI interaction data while protecting sensitive information by excluding text content. This means button clicks and UI interactions are tracked, but without any text or labels that could contain personal or sensitive data.
81+
82+
When <PlatformLink to="/configuration/options/#send-default-pii">`sendDefaultPii = true`</PlatformLink>, the SDK will additionally collect text content from UI elements including:
83+
- Text content from buttons (for example, "Submit" or "Cancel" button labels)
84+
- Semantic labels that help describe UI elements for accessibility
85+
- Tooltip messages that appear when hovering over UI elements
86+
- Text labels from icons and other UI components
87+
88+
This additional text content can be useful for debugging and understanding user interactions, but should be enabled with caution if your UI contains sensitive information.
89+
90+
## Session Replay
91+
92+
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 <PlatformLink to="/session-replay/#redact-session-replay-via-masking/">more details in the Session Replay documentation</PlatformLink>.

docs/platforms/flutter/index.mdx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ Future<void> main() async {
6161
// Setting to 1.0 will profile 100% of sampled transactions:
6262
// Note: Profiling alpha is available for iOS and macOS since SDK version 7.12.0
6363
options.profilesSampleRate = 1.0;
64+
// Adds request headers and IP for users,
65+
// visit: https://docs.sentry.io/platforms/flutter/data-management/data-collected/ for more info
66+
options.sendDefaultPii = true;
6467
},
6568
appRunner: () => runApp(
6669
SentryWidget(

0 commit comments

Comments
 (0)