Skip to content

Commit 253d903

Browse files
authored
feat(Unity): Updated options and error capture explainer (#12904)
1 parent c773e9d commit 253d903

File tree

5 files changed

+108
-97
lines changed

5 files changed

+108
-97
lines changed

docs/platforms/unity/configuration/options/index.mdx

Lines changed: 66 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -22,59 +22,29 @@ Learn more about [DSN utilization](/product/sentry-basics/dsn-explainer/#dsn-uti
2222

2323
</ConfigKey>
2424

25-
<ConfigKey name="stack-trace-mode" supported={["dotnet"]}>
26-
27-
- Original - Default .NET stack trace format.
28-
- Enhanced - Include `async`, return type, arguments, and more.
29-
30-
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.
31-
This behavior now called `StackTraceMode.Original`. With the introduction of 3.0, a new default mode is `Enhanced`.
32-
33-
<Alert>
25+
<ConfigKey name="environment">
3426

35-
Changing this value will affect issue grouping. Since the frame significantly changes shape.
27+
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).
3628

37-
</Alert>
29+
By default, the SDK reports `editor` when running inside the Unity Editor. Otherwise, the default environment is `production`.
3830

3931
</ConfigKey>
4032

41-
<ConfigKey name="is-global-mode-enabled" supported={["dotnet"]}>
42-
43-
Specifies whether to use global scope management mode. Should be `true` for client applications and `false` for server applications.
44-
45-
Example scenarios where it should be explicitly set to true:
46-
47-
- Universal Windows platform (UWP) applications
48-
- WinForms applications
49-
- Windows Presentation Foundation (WPF) applications
50-
- Single user console applications
51-
52-
Defaults to `false`, unless in Blazor WASM, MAUI, Unity, or Xamarin where the default is `true`.
53-
54-
</ConfigKey>
33+
<ConfigKey name="release">
5534

56-
<ConfigKey name="database-path" supported={["native"]}>
35+
Sets the release. The SDKk will try to automatically configure a release out of the box. 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>.
5736

58-
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).
37+
By default the SDK will read from `Application.productName` and `Application.version` to create the release in the format `$"{Application.productName}@{Application.version}".`
5938

6039
</ConfigKey>
6140

62-
<ConfigKey name="debug" notSupported={["elixir", "php"]}>
41+
<ConfigKey name="debug">
6342

6443
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.
6544

6645
</ConfigKey>
6746

68-
<ConfigKey name="logger" supported={["php", "php.laravel"]} notSupported={["php.symfony"]}>
69-
70-
If enabled, the SDK prints out debug information about if something went wrong while sending events.
71-
It isn't recommended to use this in production.
72-
73-
<PlatformContent includePath="configuration/logger/" />
74-
75-
</ConfigKey>
76-
77-
<ConfigKey name="diagnostic-level" supported={["dotnet", "java", "android", "dart", "flutter", "apple"]}>
47+
<ConfigKey name="diagnostic-level">
7848

7949
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:
8050

@@ -84,35 +54,25 @@ Enabling `debug` mode makes the SDK generate as much diagnostic data as possible
8454
- `error`: Only SDK internal errors are printed
8555
- `fatal`: Only critical errors are printed
8656

87-
</ConfigKey>
88-
8957
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.
9058

91-
<ConfigKey name="dist">
92-
93-
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.
94-
9559
</ConfigKey>
9660

97-
<ConfigKey name="release">
98-
99-
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>.
61+
## Data Enrichment & Attachments
10062

101-
By default the SDK will read from `Application.productName` and `Application.version` to create the release in the format `$"{Application.productName}@{Application.version}".`
102-
103-
</ConfigKey>
104-
105-
<ConfigKey name="environment">
63+
<ConfigKey name="in-app-include">
10664

107-
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).
65+
A list of string prefixes of module names that belong to the app. This option takes precedence over `in-app-exclude`.
10866

109-
By default, the SDK reports `editor` when running inside the Unity Editor. Otherwise, the default environment is `production`.
67+
Sentry differentiates stack frames that are directly related to your game ("in application") from stack frames that come from other packages such as the standard library, third party plugins, or other dependencies. The game's code that is part of the 'Assembly-CSharp' 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.
11068

11169
</ConfigKey>
11270

113-
<ConfigKey name="sample-rate">
71+
<ConfigKey name="in-app-exclude">
11472

115-
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.
73+
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.
74+
75+
This option can be overridden using <PlatformIdentifier name="in-app-include" />.
11676

11777
</ConfigKey>
11878

@@ -122,9 +82,9 @@ This variable controls the total amount of breadcrumbs that should be captured.
12282

12383
</ConfigKey>
12484

125-
<ConfigKey name="max-cache-items">
85+
<ConfigKey name="attach-screenshot">
12686

127-
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`.
87+
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.
12888

12989
</ConfigKey>
13090

@@ -136,68 +96,70 @@ Grouping in Sentry is different for events with stack traces and without. As a r
13696

13797
</ConfigKey>
13898

139-
<ConfigKey name="send-default-pii">
99+
<ConfigKey name="attach-screenshot">
140100

141-
If this flag is enabled, certain personally identifiable information (PII) is added by active integrations. By default, no such data is sent.
101+
Takes a screenshot of the application when an error happens and includes it as an attachment.
102+
Learn more about enriching events with screenshots in our <PlatformLink to="/enriching-events/screenshots/">Screenshots documentation</PlatformLink>.
142103

143-
<Alert>
104+
</ConfigKey>
144105

145-
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.
106+
<ConfigKey name="screenshot-quality">
146107

147-
</Alert>
108+
The quality of the attached screenshot. It can be set to `full`, `high`, `medium` or `low`.
148109

149-
This option is turned off by default.
110+
</ConfigKey>
150111

151-
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/).
112+
<ConfigKey name="attach-view-hierarchy">
152113

153-
</ConfigKey>
114+
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`.
154115

155-
<ConfigKey name="server-name">
116+
</ConfigKey>
156117

157-
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.
118+
<ConfigKey name="send-client-reports">
158119

159-
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.
120+
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.
160121

161122
</ConfigKey>
162123

163-
<ConfigKey name="in-app-include">
164-
165-
A list of string prefixes of module names that belong to the app. This option takes precedence over `in-app-exclude`.
124+
<ConfigKey name="capture-failed-requests">
166125

167-
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.
126+
Once enabled, this feature automatically captures HTTP client errors, like bad response codes, as error events and reports them to Sentry.
168127

169128
</ConfigKey>
170129

171-
<ConfigKey name="in-app-exclude">
172-
173-
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.
130+
<ConfigKey name="is-global-mode-enabled">
174131

175-
This option can be overridden using <PlatformIdentifier name="in-app-include" />.
132+
Defaults to `true`. Specifies whether to use global scope management mode. Should be `true` for client applications and `false` for server applications.
176133

177134
</ConfigKey>
178135

179-
<ConfigKey name="attach-screenshot">
136+
<ConfigKey name="distribution">
180137

181-
Takes a screenshot of the application when an error happens and includes it as an attachment.
182-
Learn more about enriching events with screenshots in our <PlatformLink to="/enriching-events/screenshots/">Screenshots documentation</PlatformLink>.
138+
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.
183139

184140
</ConfigKey>
185141

186-
<ConfigKey name="screenshot-quality">
142+
## Privacy & PII
187143

188-
The quality of the attached screenshot. It can be set to `full`, `high`, `medium` or `low`.
144+
<ConfigKey name="send-default-pii">
189145

190-
</ConfigKey>
146+
If this flag is enabled, certain personally identifiable information (PII) is added by active integrations. By default, no such data is sent.
191147

192-
<ConfigKey name="send-client-reports">
148+
<Alert>
193149

194-
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.
150+
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.
151+
152+
</Alert>
153+
154+
This option is turned off by default.
155+
156+
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/).
195157

196158
</ConfigKey>
197159

198-
<ConfigKey name="capture-failed-requests">
160+
<ConfigKey name="server-name">
199161

200-
Once enabled, this feature automatically captures HTTP client errors, like bad response codes, as error events and reports them to Sentry.
162+
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.
201163

202164
</ConfigKey>
203165

@@ -243,7 +205,7 @@ A callback function that controls view hierarchy capture behavior. Return `false
243205

244206
</ConfigKey>
245207

246-
## Transport Options
208+
## Transport & Network Options
247209

248210
Transports are used to send events to Sentry. Transports can be customized to some degree to better support highly specific deployments.
249211

@@ -253,20 +215,18 @@ Switches out the transport used to send events. How this works depends on the SD
253215

254216
</ConfigKey>
255217

256-
<ConfigKey name="http-proxy">
218+
<ConfigKey name="max-cache-items">
257219

258-
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.
220+
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`.
259221

260222
</ConfigKey>
261223

262-
<ConfigKey name="cache-directory-path">
224+
<ConfigKey name="http-proxy">
263225

264-
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.
226+
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.
265227

266228
</ConfigKey>
267229

268-
The default value is `Application.persistentDataPath`. You can disable offline caching by setting it to `null`.
269-
270230
<ConfigKey name="init-cache-flush-timeout">
271231

272232
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 +254,15 @@ A number between `0` and `1`, controlling the percentage chance a given transact
294254
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.
295255

296256
</ConfigKey>
257+
258+
<ConfigKey name="auto-startup-traces">
259+
260+
Controls whether the SDK will automatically trace the app's startup.
261+
262+
</ConfigKey>
263+
264+
<ConfigKey name="auto-scene-traces">
265+
266+
Controls whether the SDK will automatically trace when loading scenes.
267+
268+
</ConfigKey>

0 commit comments

Comments
 (0)