-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
feat(javascript): Add "Data Collected" #13527
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 5 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
356dcbf
feat(javascript): Add "Data Collected"
s1gr1d 75184b3
add context lines; fix broken links
s1gr1d 5d24e9e
fix 404
s1gr1d f07b43a
fix 404
s1gr1d 9fe3d5b
review suggestions
s1gr1d 9361a13
review suggestions
s1gr1d 2fd0142
fix 404
s1gr1d File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
134 changes: 134 additions & 0 deletions
134
docs/platforms/javascript/common/data-management/data-collected/index.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,134 @@ | ||
--- | ||
title: Data Collected | ||
description: "See what data is collected by the Sentry SDK." | ||
sidebar_order: 1 | ||
notSupported: | ||
- javascript.electron | ||
--- | ||
|
||
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. | ||
s1gr1d marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
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. | ||
s1gr1d marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
Many of the categories listed here require you to enable the <PlatformLink to="/configuration/options/#sendDefaultPii">sendDefaultPii option</PlatformLink>. | ||
|
||
## HTTP Headers | ||
|
||
By default, the Sentry SDK sends HTTP response or request headers. | ||
|
||
## 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 in Django. | ||
s1gr1d marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
If you want to send cookies, set `sendDefaultPii: true` in the `Sentry.init()` call. This will send the cookie headers `Cookie` and `Set-Cookie` from fetch and XHR requests. | ||
|
||
## 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. | ||
|
||
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 integrations (e.g. <PlatformLink to="/user-feedback/">User Feedback</PlatformLink>) make it possible to send data like the user ID, username, and email address. | ||
|
||
## Users' IP Address and Location | ||
|
||
By default, the Sentry SDK doesn't send the user's IP address. | ||
|
||
To enable sending the user's IP address and infer the location, set <PlatformLink to="/configuration/options/#sendDefaultPii">`sendDefaultPii: true`</PlatformLink>. In some integrations such as <PlatformLink to="/guides/astro/#customize-server-instrumentation">`handleRequest`</PlatformLink> in Astro, you can send the user's IP address by enabling `trackClientIp`. | ||
|
||
If sending the IP address is enabled we will try to infer the IP address or use the IP address provided by `ip_address` in <PlatformLink to="/apis/#setUser">`Sentry.setUser()`</PlatformLink>. If you set `ip_address: null`, the IP address won't be inferred. | ||
|
||
## 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. For example, a URL like `/users/1234/details`, where `1234` is a user id (which may be considered PII). | ||
|
||
## 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. For example, a query string like `?user_id=1234`, where `1234` is a user id (which may be considered PII). | ||
|
||
However, Sentry has some default [server-side data scrubbing](/security-legal-pii/scrubbing/server-side-scrubbing/) in place to remove sensitive data from the query string. For example, the `apiKey` and `token` query parameters are removed by default. | ||
|
||
## Request Body | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this apply to all requests we collect (everywhere)? I'd specifically mention if this applies to incoming or outgoing requests because I think there's different behaviour, right? |
||
|
||
By default, Sentry sends the size of the body content of incoming HTTP requests. This is inferred from the `content-length` header. Sentry does not send the request body itself on the client-side. | ||
|
||
<PlatformSection notSupported={["javascript", "javascript.angular", "javascript.capacitor", "javascript.cordova", "javascript.ember", "javascript.gatsby", "javascript.react", "javascript.solid", "javascript.svelte", "javascript.vue", "javascript.wasm"]}> | ||
On the server-side, the incoming request body is captured by default. You can disable sending the incoming request body by configuring `ignoreIncomingRequestBody` in the <PlatformLink to="/configuration/integrations/http/">HTTP Integration</PlatformLink>. | ||
</PlatformSection> | ||
|
||
<PlatformSection supported={["javascript.remix"]}> | ||
If `sendDefaultPii` is enabled, you can send Form Data with `captureActionFormDataKeys` in the Remix <PlatformLink to="/manual-setup/#server-side-configuration">server-side configuration</PlatformLink>. | ||
</PlatformSection> | ||
|
||
## Response Body | ||
|
||
By default, the Sentry SDK doesn't send the body content of responses received from outgoing requests. By default, the SDK will send the response body size based on the `content-length` header. | ||
|
||
## Source Context | ||
|
||
By default, SDKs set up by the Sentry CLI Wizard (`@sentry/wizard`) will enable uploading source maps to Sentry. | ||
|
||
To disable source map upload, see <PlatformLink to="/sourcemaps">the Source Maps documentation</PlatformLink>. | ||
|
||
## Local Variables In Stack Trace | ||
|
||
The Sentry SDK does not send local variables in the error stack trace in client-side JavaScript SDKs. | ||
|
||
<PlatformSection notSupported={["javascript", "javascript.angular", "javascript.capacitor", "javascript.cordova", "javascript.ember", "javascript.gatsby", "javascript.react", "javascript.solid", "javascript.svelte", "javascript.vue", "javascript.wasm"]}> | ||
You can enable sending local variables by setting `includeLocalVariables: true` in the `Sentry.init()` call. This activates the <PlatformLink to="/configuration/integrations/localvariables">Local Variables Integration</PlatformLink>. The integration is added by default in Node.js-based runtimes. | ||
</PlatformSection> | ||
|
||
## Device, Browser, OS and Runtime Information | ||
|
||
By default, the Sentry SDK sends information about the device and runtime to Sentry. | ||
|
||
In browser environments, this information is obtained by the User Agent string. The User Agent string contains information about the browser, operating system, and device type. | ||
|
||
In server-side environments, the Sentry SDK uses the `os` module to get information about the operating system and architecture. | ||
|
||
<PlatformSection notSupported={["javascript.azure-functions", "javascript.bun", "javascript.deno", "javascript.node", "javascript.aws-lambda", "javascript.connect", "javascript.cloudflare", "javascript.express", "javascript.fastify", "javascript.gcp-functions", "javascript.hapi", "javascript.hono", "javascript.koa", "javascript.nestjs", "javascript.wasm"]}> | ||
<PlatformSection notSupported={["javascript.cordova"]}> | ||
## Session Replay | ||
|
||
By default, our Session Replay SDK masks all text content, images, web views, and user input. This helps ensure that no sensitive data is exposed. You can find <PlatformLink to="/session-replay/privacy/">more details in the Session Replay documentation</PlatformLink>. | ||
|
||
Session Replay also captures basic information about all outgoing fetch and XHR requests in your application. This includes the URL, request and response body size, method, and status code. If <PlatformLink to="/session-replay/configuration/#network-details">`networkDetailAllowUrls`</PlatformLink> are defined, the request and response body will be sent to Sentry as well. This can include PII data if the request or response body contains PII information. | ||
s1gr1d marked this conversation as resolved.
Show resolved
Hide resolved
|
||
</PlatformSection> | ||
|
||
## Referrer URL | ||
|
||
By default, the Sentry SDK sends the referrer URL to Sentry. This is the URL of the page that linked to the current page. | ||
|
||
## Console Logs | ||
|
||
By default, the Sentry SDK sends JS console logs to Sentry as breadcrumbs which may contain PII data. | ||
|
||
To disable sending console messages, set `console: false` in your `Sentry.breadcrumbsIntegration` config, see <PlatformLink to="/configuration/integrations/breadcrumbs/">the Breadcrumbs documentation</PlatformLink>. | ||
|
||
</PlatformSection> | ||
|
||
<PlatformSection notSupported={["javascript", "javascript.angular", "javascript.capacitor", "javascript.cloudflare", "javascript.cordova", "javascript.ember", "javascript.gatsby", "javascript.react", "javascript.solid", "javascript.svelte", "javascript.vue", "javascript.wasm"]}> | ||
<PlatformSection notSupported={["javascript.fastify", "javascript.hono"]}> | ||
## Stack Trace Context Lines | ||
|
||
By default, the <PlatformLink to="/configuration/integrations/contextlines/">Context Lines Integration</PlatformLink> is enabled. This integration sends the surrounding lines of code for each frame in the stack trace. This can include PII data if the code contains PII information. | ||
</PlatformSection> | ||
|
||
<PlatformSection notSupported={["javascript.deno"]}> | ||
## LLM Inputs And Responses | ||
|
||
When using the <PlatformLink to="/configuration/integrations/vercelai/">Vercel AI Integration</PlatformLink>, the used prompt is sent to Sentry along with meta data like model ID and used tokens. Check out the full list of attributes [in the code](https://github.com/getsentry/sentry-javascript/blob/master/packages/node/src/integrations/tracing/vercelai/index.ts). | ||
|
||
## Database Queries | ||
|
||
By default, the Sentry SDK sends SQL queries to Sentry. The SQL queries can include PII information if the statement is not parametrized. | ||
|
||
MongoDB queries are sent as well, but the Sentry SDK will not send the full MongoDB query. Instead, it will send a parameterized version of the query. | ||
|
||
</PlatformSection> | ||
|
||
## tRPC Context | ||
|
||
By default, the Sentry SDK doesn't send tRPC input from the tRPC context. | ||
|
||
If you want to send the tRPC input you can enable it by setting `sendDefaultPii: true` in the `Sentry.init()` call or by setting `attachRpcInput: true` in the <PlatformLink to="/configuration/integrations/trpc/">`Sentry.trpcMiddleware()`</PlatformLink> options. | ||
|
||
</PlatformSection> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.