Skip to content

feat(electron): Add "Data Collected" #13617

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ notSupported:
- javascript.aws-lambda
- javascript.azure-functions
- javascript.connect
- javascript.electron
- javascript.express
- javascript.fastify
- javascript.gcp-functions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
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 and build time of your application.
Expand All @@ -28,6 +26,12 @@ By default, the Sentry SDK doesn't send any information about the logged-in user

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.

<PlatformSection supported={["javascript.electron"]}>
### Local Device User

By default, the Sentry SDK doesn't send any information about the user currently logged-in to the device where the app is running. However, you should exercise caution when logging file system errors as paths may contain the current username.
</PlatformSection>

## Users' IP Address and Location

By default, the Sentry SDK doesn't send the user's IP address.
Expand Down Expand Up @@ -80,9 +84,21 @@ The Sentry SDK does not send local variables in the error stack trace in client-

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.
<PlatformSection notSupported={["javascript.electron"]}>
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>

In server-side environments, the Sentry SDK uses the `os` module to get information about the operating system and architecture.
<PlatformSection supported={["javascript.electron"]}>
The Sentry Electron SDK collects information about the device, such as the platform, architecture, available memory and version and build of your operating system or Linux distribution.

By default, the <PlatformLink to="/configuration/integrations/additionalcontext">Additional Context Integration</PlatformLink> collects dimensions and resolution of the device screen. It can optionally collect the device's manufacturer and model name if the `deviceModelManufacturer` option is enabled.

By default, the <PlatformLink to="/configuration/integrations/gpucontext">GPU Context Integration</PlatformLink> collects GPU information. It can optionally collect more detailed information if the `infoLevel` option is set to `complete`.


</PlatformSection>

<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"]}>
Expand All @@ -101,10 +117,11 @@ In server-side environments, the Sentry SDK uses the `os` module to get informat

To disable sending console messages, set `console: false` in your `Sentry.breadcrumbsIntegration` config, see <PlatformLink to="/configuration/integrations/breadcrumbs/">the Breadcrumbs documentation</PlatformLink>.

## 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.
<PlatformSection notSupported={["javascript.electron"]}>
## 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.
</PlatformSection>
</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"]}>
Expand Down Expand Up @@ -134,3 +151,16 @@ In server-side environments, the Sentry SDK uses the `os` module to get informat
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>

<PlatformSection supported={["javascript.electron"]}>

## Window Titles

The <PlatformLink to="/configuration/integrations/electronbreadcrumbs/">Electron Breadcrumbs Integration</PlatformLink> can optionally capture the window titles for breadcrumbs related to windows events. These can potentially contain PII so are disabled by default but can be enabled via the `captureWindowTitles` option.

## Native Crashes

At the time of a native crash, the stack of each thread is collected and sent to Sentry as part of the Minidump snapshot. This information is sent to Sentry by default, but dropped after processing the event in the backend.

These files are not stored by default, but you can [enable Minidump Storage](https://docs.sentry.io/platforms/native/guides/minidumps/enriching-events/attachments/#store-minidumps-as-attachments) in the Sentry organization or project settings.
</PlatformSection>
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,19 @@ sidebar_order: 10

Adds additional device context to events.

This integration takes a number of options, which all default to `true`:

```typescript
interface AdditionalContextOptions {
/**
* Capture dimensions and resolution of the primary display
* @default true
*/
screen: boolean;
/**
* Capture device model and manufacturer.
* No supported on Linux.
* @default false
*/
deviceModelManufacturer: boolean;
}
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ Sentry.init({
].includes(name),
screen: true,
powerMonitor: true,
captureWindowTitles: false,
}),
],
});
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
title: GPUContext
excerpt: ""
description: "Adds GPU device context to events. (default)"
sidebar_order: 10
---

Adds GPU device context to events.

This integration takes a number of options, which all default to `true`:

```typescript
interface GPUContextOptions {
/**
* How much GPU information to request from Electron `app.getGPUInfo` API.
* `complete` can take much longer to resolve so the default is `basic`.
* - 'basic': Usually only the `vendor_id` and `id` but some platforms supply more.
* - 'complete': More detailed information including full names and driver_version.
*
* @default 'basic'
*/
infoLevel: "basic" | "complete";
}
```

To get complete GPU information, set `infoLevel` to `complete`:

```javascript
import * as Sentry from "@sentry/electron/main";

Sentry.init({
dsn: "___PUBLIC_DSN___",
integrations: [
Sentry.gpuContextIntegration({
infoLevel: "complete",
}),
],
});
```
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,6 @@ interface NetOptions {
* Defaults to: true
*/
tracing: boolean | (method: string, url: string) => boolean;
/**
* Whether to add 'sentry-trace' headers to outgoing requests
*
* Defaults to: true
*/
tracingOrigins: boolean | (method: string, url: string) => boolean;
}
```

Expand All @@ -44,7 +38,6 @@ Sentry.init({
Sentry.electronNetIntegration({
breadcrumbs: false,
tracing: (method) => method == "POST",
tracingOrigins: false,
}),
],
});
Expand Down