-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
feat(Unity): Updated options
and error capture explainer
#12904
base: master
Are you sure you want to change the base?
Changes from all commits
87b4c81
cc4b9d2
20d6ed2
26f69cd
8c5b443
37294bb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -22,59 +22,29 @@ Learn more about [DSN utilization](/product/sentry-basics/dsn-explainer/#dsn-uti | |||||
|
||||||
</ConfigKey> | ||||||
|
||||||
<ConfigKey name="stack-trace-mode" supported={["dotnet"]}> | ||||||
|
||||||
- Original - Default .NET stack trace format. | ||||||
- Enhanced - Include `async`, return type, arguments, and more. | ||||||
|
||||||
Before version 3.0.0 of the Sentry SDK for .NET, there was no special treatment for the stack trace. Sentry reported what .NET made available at runtime. | ||||||
This behavior now called `StackTraceMode.Original`. With the introduction of 3.0, a new default mode is `Enhanced`. | ||||||
|
||||||
<Alert> | ||||||
<ConfigKey name="environment"> | ||||||
|
||||||
Changing this value will affect issue grouping. Since the frame significantly changes shape. | ||||||
Sets the environment. This string is freeform and set by default. A release can be associated with more than one environment to separate them in the UI (think `staging` vs `prod` or similar). | ||||||
|
||||||
</Alert> | ||||||
By default, the SDK reports `editor` when running inside the Unity Editor. Otherwise, the default environment is `production`. | ||||||
|
||||||
</ConfigKey> | ||||||
|
||||||
<ConfigKey name="is-global-mode-enabled" supported={["dotnet"]}> | ||||||
|
||||||
Specifies whether to use global scope management mode. Should be `true` for client applications and `false` for server applications. | ||||||
|
||||||
Example scenarios where it should be explicitly set to true: | ||||||
|
||||||
- Universal Windows platform (UWP) applications | ||||||
- WinForms applications | ||||||
- Windows Presentation Foundation (WPF) applications | ||||||
- Single user console applications | ||||||
|
||||||
Defaults to `false`, unless in Blazor WASM, MAUI, Unity, or Xamarin where the default is `true`. | ||||||
|
||||||
</ConfigKey> | ||||||
<ConfigKey name="release"> | ||||||
|
||||||
<ConfigKey name="database-path" supported={["native"]}> | ||||||
Sets the release. Some SDKs will try to automatically configure a release out of the box but it's a better idea to manually set it, guaranteeing that the release is in sync with your deploy integrations or source map uploads. Release names are strings, but some formats are detected by Sentry and might be rendered differently. Learn more about how to send release data so Sentry can tell you about regressions between releases and identify the potential source in [the releases documentation](/product/releases/) or the <SandboxLink scenario="releases">sandbox</SandboxLink>. | ||||||
|
||||||
Allows you to specify a path to the local event- and crash-database of the Native SDK. This path will default to `.sentry-native` relative to the current working directory (`CWD`). While this is a convenient setting for development, we strongly urge you to provide an explicit database path for our production deployments. In many deployment scenarios, the path relative to the `CWD` will not be writable. For this reason, you should store the database in your application's user-specific data/cache directory (e.g., under `%AppData%\Local` on Windows, `~/Library/Application Support` on macOS, or `XDG_CACHE_HOME` on Linux). | ||||||
By default the SDK will read from `Application.productName` and `Application.version` to create the release in the format `$"{Application.productName}@{Application.version}".` | ||||||
|
||||||
</ConfigKey> | ||||||
|
||||||
<ConfigKey name="debug" notSupported={["elixir", "php"]}> | ||||||
<ConfigKey name="debug"> | ||||||
|
||||||
Turns debug mode on or off. If debug is enabled SDK will attempt to print out useful debugging information if something goes wrong with sending the event. The default is always `false`. It's generally not recommended to turn it on in production, though turning `debug` mode on will not cause any safety concerns. | ||||||
|
||||||
</ConfigKey> | ||||||
|
||||||
<ConfigKey name="logger" supported={["php", "php.laravel"]} notSupported={["php.symfony"]}> | ||||||
|
||||||
If enabled, the SDK prints out debug information about if something went wrong while sending events. | ||||||
It isn't recommended to use this in production. | ||||||
|
||||||
<PlatformContent includePath="configuration/logger/" /> | ||||||
|
||||||
</ConfigKey> | ||||||
|
||||||
<ConfigKey name="diagnostic-level" supported={["dotnet", "java", "android", "dart", "flutter", "apple"]}> | ||||||
<ConfigKey name="diagnostic-level"> | ||||||
|
||||||
Enabling `debug` mode makes the SDK generate as much diagnostic data as possible. However, if you'd prefer to lower the verbosity of the Sentry SDK diagnostics logs, configure this option to set the appropriate level: | ||||||
|
||||||
|
@@ -84,35 +54,25 @@ Enabling `debug` mode makes the SDK generate as much diagnostic data as possible | |||||
- `error`: Only SDK internal errors are printed | ||||||
- `fatal`: Only critical errors are printed | ||||||
|
||||||
</ConfigKey> | ||||||
|
||||||
For app models that don't have a console to print to, you can <PlatformLink to="/configuration/diagnostic-logger/">customize the SDK's diagnostic logger</PlatformLink> to write to a file or to Visual Studio's debug window. | ||||||
|
||||||
<ConfigKey name="dist"> | ||||||
|
||||||
Sets the distribution of the application. Distributions are used to disambiguate build or deployment variants of the same release of an application. For example, the dist can be the build number of an Xcode build or the version code of an Android build. The dist has a max length of 64 characters. | ||||||
|
||||||
</ConfigKey> | ||||||
|
||||||
<ConfigKey name="release"> | ||||||
|
||||||
Sets the release. Some SDKs will try to automatically configure a release out of the box but it's a better idea to manually set it to guarantee that the release is in sync with your deploy integrations or source map uploads. Release names are strings, but some formats are detected by Sentry and might be rendered differently. Learn more about how to send release data so Sentry can tell you about regressions between releases and identify the potential source in [the releases documentation](/product/releases/) or the <SandboxLink scenario="releases">sandbox</SandboxLink>. | ||||||
|
||||||
By default the SDK will read from `Application.productName` and `Application.version` to create the release in the format `$"{Application.productName}@{Application.version}".` | ||||||
## Data Enrichment & Attachments | ||||||
|
||||||
</ConfigKey> | ||||||
|
||||||
<ConfigKey name="environment"> | ||||||
<ConfigKey name="in-app-include"> | ||||||
|
||||||
Sets the environment. This string is freeform and set by default. A release can be associated with more than one environment to separate them in the UI (think `staging` vs `prod` or similar). | ||||||
A list of string prefixes of module names that belong to the app. This option takes precedence over `in-app-exclude`. | ||||||
|
||||||
By default, the SDK reports `editor` when running inside the Unity Editor. Otherwise, the default environment is `production`. | ||||||
Sentry differentiates stack frames that are directly related to your application ("in application") from stack frames that come from other packages such as the standard library, frameworks, or other dependencies. The application package is automatically marked as `inApp`. The difference is visible in [sentry.io](https://sentry.io), where only the "in application" frames are displayed by default. | ||||||
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. How about being specific here too (what lingo makes more sense for Unity devs?)
Suggested change
|
||||||
|
||||||
</ConfigKey> | ||||||
|
||||||
<ConfigKey name="sample-rate"> | ||||||
<ConfigKey name="in-app-exclude"> | ||||||
|
||||||
Configures the sample rate for error events, in the range of `0.0` to `1.0`. The default is `1.0`, which means that 100% of error events will be sent. If set to `0.1`, only 10% of error events will be sent. Events are picked randomly. | ||||||
A list of string prefixes of module names that do not belong to the app, but rather to third-party packages. Modules considered not part of the app will be hidden from stack traces by default. | ||||||
|
||||||
This option can be overridden using <PlatformIdentifier name="in-app-include" />. | ||||||
|
||||||
</ConfigKey> | ||||||
|
||||||
|
@@ -122,9 +82,9 @@ This variable controls the total amount of breadcrumbs that should be captured. | |||||
|
||||||
</ConfigKey> | ||||||
|
||||||
<ConfigKey name="max-cache-items"> | ||||||
<ConfigKey name="attach-screenshot"> | ||||||
|
||||||
The maximum number of [envelopes](https://develop.sentry.dev/sdk/data-model/envelopes/) to keep in cache. The SDKs use envelopes to send data, such as events, attachments, user feedback, and sessions to sentry.io. An envelope can contain multiple items, such as an event with a session and two attachments. Depending on the usage of the SDK, the size of an envelope can differ. If the number of envelopes in the local cache exceeds `max-cache-items`, the SDK deletes the oldest envelope and migrates the sessions to the next envelope to maintain the integrity of your release health stats. The default is `30`. | ||||||
This variable controls the total amount of breadcrumbs that should be captured. This defaults to `100`, but you can set this to any number. Just be aware that Sentry has a [maximum payload size](https://develop.sentry.dev/sdk/data-model/envelopes/#size-limits) and any events exceeding that payload size will be dropped. | ||||||
|
||||||
</ConfigKey> | ||||||
|
||||||
|
@@ -136,68 +96,97 @@ Grouping in Sentry is different for events with stack traces and without. As a r | |||||
|
||||||
</ConfigKey> | ||||||
|
||||||
<ConfigKey name="send-default-pii"> | ||||||
<ConfigKey name="stack-trace-mode"> | ||||||
|
||||||
If this flag is enabled, certain personally identifiable information (PII) is added by active integrations. By default, no such data is sent. | ||||||
- Original - Default .NET stack trace format. | ||||||
- Enhanced - Include `async`, return type, arguments, and more. | ||||||
|
||||||
Before version 3.0.0 of the Sentry SDK for .NET, there was no special treatment for the stack trace. Sentry reported what .NET made available at runtime. | ||||||
This behavior now called `StackTraceMode.Original`. With the introduction of 3.0, the new default mode is `Enhanced`. | ||||||
|
||||||
<Alert> | ||||||
|
||||||
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. | ||||||
Changing this value will affect issue grouping since the frame significantly changes shape. | ||||||
|
||||||
</Alert> | ||||||
|
||||||
This option is turned off by default. | ||||||
</ConfigKey> | ||||||
|
||||||
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/). | ||||||
<ConfigKey name="attach-screenshot"> | ||||||
|
||||||
Takes a screenshot of the application when an error happens and includes it as an attachment. | ||||||
Learn more about enriching events with screenshots in our <PlatformLink to="/enriching-events/screenshots/">Screenshots documentation</PlatformLink>. | ||||||
|
||||||
</ConfigKey> | ||||||
|
||||||
<ConfigKey name="server-name"> | ||||||
<ConfigKey name="screenshot-quality"> | ||||||
|
||||||
This option can be used to supply a server name. When provided, the name of the server is sent along and persisted in the event. For many integrations, the server name actually corresponds to the device hostname, even in situations where the machine is not actually a server. | ||||||
The quality of the attached screenshot. It can be set to `full`, `high`, `medium` or `low`. | ||||||
|
||||||
For ASP.NET and ASP.NET Core applications, the value will default to the server's name. For other application types, the value will default to the computer's name only when the `SendDefaultPii` is set to `true`, because the computer's name can be considered personally identifiable information (PII) in the case of a desktop or mobile application. | ||||||
</ConfigKey> | ||||||
|
||||||
<ConfigKey name="attach-view-hierarchy"> | ||||||
|
||||||
Captures the currently active scene's hierarchy and creates a `ViewHierarchy` when an error happens and includes it as an attachment. The creation is influenced by `MaxViewHierarchyRootObjects`, `MaxViewHierarchyDepth`, and `MaxViewHierarchyObjectChildCount`. | ||||||
|
||||||
</ConfigKey> | ||||||
|
||||||
<ConfigKey name="in-app-include"> | ||||||
<ConfigKey name="send-client-reports"> | ||||||
|
||||||
A list of string prefixes of module names that belong to the app. This option takes precedence over `in-app-exclude`. | ||||||
Set this boolean to `false` to disable sending of client reports. Client reports are a protocol feature that let clients send status reports about themselves to Sentry. They are currently mainly used to emit outcomes for events that were never sent. | ||||||
|
||||||
Sentry differentiates stack frames that are directly related to your application ("in application") from stack frames that come from other packages such as the standard library, frameworks, or other dependencies. The application package is automatically marked as `inApp`. The difference is visible in [sentry.io](https://sentry.io), where only the "in application" frames are displayed by default. | ||||||
</ConfigKey> | ||||||
|
||||||
<ConfigKey name="capture-failed-requests"> | ||||||
|
||||||
Once enabled, this feature automatically captures HTTP client errors, like bad response codes, as error events and reports them to Sentry. | ||||||
|
||||||
</ConfigKey> | ||||||
|
||||||
<ConfigKey name="in-app-exclude"> | ||||||
<ConfigKey name="is-global-mode-enabled"> | ||||||
|
||||||
A list of string prefixes of module names that do not belong to the app, but rather to third-party packages. Modules considered not part of the app will be hidden from stack traces by default. | ||||||
Specifies whether to use global scope management mode. Should be `true` for client applications and `false` for server applications. | ||||||
|
||||||
This option can be overridden using <PlatformIdentifier name="in-app-include" />. | ||||||
Example scenarios where it should be explicitly set to true: | ||||||
|
||||||
- Universal Windows platform (UWP) applications | ||||||
- WinForms applications | ||||||
- Windows Presentation Foundation (WPF) applications | ||||||
- Single user console applications | ||||||
Comment on lines
+152
to
+155
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. how about listing Unity deployment types here? Unity Server, vs Unity on a Mobile, Desktop or Web app? |
||||||
|
||||||
Defaults to `false`, unless in Blazor WASM, MAUI, Unity, or Xamarin where the default is `true`. | ||||||
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. Not relevant
Suggested change
|
||||||
|
||||||
</ConfigKey> | ||||||
|
||||||
<ConfigKey name="attach-screenshot"> | ||||||
<ConfigKey name="distribution"> | ||||||
|
||||||
Takes a screenshot of the application when an error happens and includes it as an attachment. | ||||||
Learn more about enriching events with screenshots in our <PlatformLink to="/enriching-events/screenshots/">Screenshots documentation</PlatformLink>. | ||||||
Sets the distribution of the application. Distributions are used to disambiguate build or deployment variants of the same release of an application. For example, the dist can be the build number of an Xcode build or the version code of an Android build. The dist has a max length of 64 characters. | ||||||
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. Do we set this automatically on Unity? |
||||||
|
||||||
</ConfigKey> | ||||||
|
||||||
<ConfigKey name="screenshot-quality"> | ||||||
## Privacy & PII | ||||||
|
||||||
The quality of the attached screenshot. It can be set to `full`, `high`, `medium` or `low`. | ||||||
<ConfigKey name="send-default-pii"> | ||||||
|
||||||
</ConfigKey> | ||||||
If this flag is enabled, certain personally identifiable information (PII) is added by active integrations. By default, no such data is sent. | ||||||
|
||||||
<ConfigKey name="send-client-reports"> | ||||||
<Alert> | ||||||
|
||||||
Set this boolean to `false` to disable sending of client reports. Client reports are a protocol feature that let clients send status reports about themselves to Sentry. They are currently mainly used to emit outcomes for events that were never sent. | ||||||
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. | ||||||
|
||||||
</Alert> | ||||||
|
||||||
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/). | ||||||
|
||||||
</ConfigKey> | ||||||
|
||||||
<ConfigKey name="capture-failed-requests"> | ||||||
<ConfigKey name="server-name"> | ||||||
|
||||||
Once enabled, this feature automatically captures HTTP client errors, like bad response codes, as error events and reports them to Sentry. | ||||||
This option can be used to supply a server name. When provided, the name of the server is sent along and persisted in the event. For many integrations, the server name actually corresponds to the device hostname, even in situations where the machine is not actually a server. | ||||||
|
||||||
For ASP.NET and ASP.NET Core applications, the value will default to the server's name. For other application types, the value will default to the computer's name only when the `SendDefaultPii` is set to `true`, because the computer's name can be considered personally identifiable information (PII) in the case of a desktop or mobile application. | ||||||
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. Pro not relevant either |
||||||
|
||||||
</ConfigKey> | ||||||
|
||||||
|
@@ -243,7 +232,7 @@ A callback function that controls view hierarchy capture behavior. Return `false | |||||
|
||||||
</ConfigKey> | ||||||
|
||||||
## Transport Options | ||||||
## Transport & Network Options | ||||||
|
||||||
Transports are used to send events to Sentry. Transports can be customized to some degree to better support highly specific deployments. | ||||||
|
||||||
|
@@ -253,20 +242,18 @@ Switches out the transport used to send events. How this works depends on the SD | |||||
|
||||||
</ConfigKey> | ||||||
|
||||||
<ConfigKey name="http-proxy"> | ||||||
<ConfigKey name="max-cache-items"> | ||||||
|
||||||
When set, a proxy can be configured that should be used for outbound requests. This is also used for HTTPS requests unless a separate `https-proxy` is configured. However, not all SDKs support a separate HTTPS proxy. SDKs will attempt to default to the system-wide configured proxy, if possible. For instance, on Unix systems, the `http_proxy` environment variable will be picked up. | ||||||
The maximum number of [envelopes](https://develop.sentry.dev/sdk/data-model/envelopes/) to keep in cache. The SDKs use envelopes to send data, such as events, attachments, user feedback, and sessions to sentry.io. An envelope can contain multiple items, such as an event with a session and two attachments. Depending on the usage of the SDK, the size of an envelope can differ. If the number of envelopes in the local cache exceeds `max-cache-items`, the SDK deletes the oldest envelope and migrates the sessions to the next envelope to maintain the integrity of your release health stats. The default is `30`. | ||||||
|
||||||
</ConfigKey> | ||||||
|
||||||
<ConfigKey name="cache-directory-path"> | ||||||
<ConfigKey name="http-proxy"> | ||||||
|
||||||
Specifies a local directory used for caching payloads. When this option is enabled (that is, when the directory is set), the Sentry SDK will persist envelopes locally before sending to Sentry. This configuration option is particularly useful if you expect your application to run in environments where internet connectivity is limited. | ||||||
When set, a proxy can be configured that should be used for outbound requests. This is also used for HTTPS requests unless a separate `https-proxy` is configured. However, not all SDKs support a separate HTTPS proxy. SDKs will attempt to default to the system-wide configured proxy, if possible. For instance, on Unix systems, the `http_proxy` environment variable will be picked up. | ||||||
|
||||||
</ConfigKey> | ||||||
|
||||||
The default value is `Application.persistentDataPath`. You can disable offline caching by setting it to `null`. | ||||||
|
||||||
<ConfigKey name="init-cache-flush-timeout"> | ||||||
|
||||||
When caching is enabled (that is, <PlatformIdentifier name="cache-directory-path" /> is set), this option controls the timeout that limits how long the SDK will attempt to flush existing cache during initialization. Note that flushing the cache involves sending the payload to Sentry in a blocking operation. Setting this option to zero means that Sentry will **not** attempt to flush the cache during initialization, but instead will do so when the next payload is queued up. | ||||||
|
@@ -294,3 +281,15 @@ A number between `0` and `1`, controlling the percentage chance a given transact | |||||
A function responsible for determining the percentage chance a given transaction will be sent to Sentry. It will automatically be passed information about the transaction and the context in which it's being created, and must return a number between `0` (0% chance of being sent) and `1` (100% chance of being sent). Can also be used for filtering transactions, by returning 0 for those that are unwanted. Either this or <PlatformIdentifier name="traces-sample-rate" /> must be defined to enable tracing. | ||||||
|
||||||
</ConfigKey> | ||||||
|
||||||
<ConfigKey name="auto-startup-traces"> | ||||||
|
||||||
Controls whether the SDK will automatically trace the app's startup. | ||||||
|
||||||
</ConfigKey> | ||||||
|
||||||
<ConfigKey name="auto-scene-traces"> | ||||||
|
||||||
Controls whether the SDK will automatically trace when loading scenes. | ||||||
|
||||||
</ConfigKey> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Some SDKs" seems generic. Here we know it's Unity. Is it benefitial to set something manually in Unity? I think our auto detection is quite on point since it relies on the Unitys' version already right?