-
-
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?
Conversation
…d added explainer on how the SDK captures errors
The latest updates on your projects. Learn more about Vercel for Git ↗︎
2 Skipped Deployments
|
Bundle ReportChanges will increase total bundle size by 210 bytes (0.0%) ⬆️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: sentry-docs-server-cjsAssets Changed:
view changes for bundle: sentry-docs-client-array-pushAssets Changed:
|
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.
Thanks for updating! 🤠
Co-authored-by: Alex Krawiec <[email protected]>
|
||
<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>. |
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?
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>. |
|
||
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 comment
The 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?)
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. | |
Sentry differentiates stack frames that are directly related to your application ("in application") from stack frames that come from other packages such Unity's APIs, .NET's APIs, or other packages and 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. |
- Universal Windows platform (UWP) applications | ||
- WinForms applications | ||
- Windows Presentation Foundation (WPF) applications | ||
- Single user console applications |
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.
how about listing Unity deployment types here? Unity Server, vs Unity on a Mobile, Desktop or Web app?
- 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`. |
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.
Not relevant
Defaults to `false`, unless in Blazor WASM, MAUI, Unity, or Xamarin where the default is `true`. |
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 comment
The reason will be displayed to describe this comment to others. Learn more.
Pro not relevant either
|
||
## UnityLogHandlerIntegration | ||
|
||
The SDK uses the `UnityLogHandlerIntegration` to hook into Unity's logging system. From there it receives all log messages that are logged via the `Debug.Log`, `Debug.LogWarning`, and `Debug.LogError` methods and those log messages are added as breadcrumbs to future events. By default, the SDK will also automatically capture messages logged via `Debug.LogError` as error events and send them to Sentry. This behaviour can be disabled by unchecking the automatic capture of `Debug.LogError` on the `Enrichment` tab, or programmatically, by setting the `CaptureLogErrorEvents` option to `false` in the [configure callback](/platforms/unity/configuration/options/programmatic-configuration). |
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.
tab
could be in Sentry (sentry.io)
The SDK uses the `UnityLogHandlerIntegration` to hook into Unity's logging system. From there it receives all log messages that are logged via the `Debug.Log`, `Debug.LogWarning`, and `Debug.LogError` methods and those log messages are added as breadcrumbs to future events. By default, the SDK will also automatically capture messages logged via `Debug.LogError` as error events and send them to Sentry. This behaviour can be disabled by unchecking the automatic capture of `Debug.LogError` on the `Enrichment` tab, or programmatically, by setting the `CaptureLogErrorEvents` option to `false` in the [configure callback](/platforms/unity/configuration/options/programmatic-configuration). | |
The SDK uses the `UnityLogHandlerIntegration` to hook into Unity's logging system. From there it receives all log messages that are logged via the `Debug.Log`, `Debug.LogWarning`, and `Debug.LogError` methods and those log messages are added as breadcrumbs to future events. By default, the SDK will also automatically capture messages logged via `Debug.LogError` as error events and send them to Sentry. This behaviour can be disabled by unchecking the automatic capture of `Debug.LogError` on the `Enrichment` tab in the editor (Tools->Sentry), or programmatically, by setting the `CaptureLogErrorEvents` option to `false` in the [configure callback](/platforms/unity/configuration/options/programmatic-configuration). |
|
||
### Stack Trace Support & Line Numbers | ||
|
||
If [configured](https://docs.unity3d.com/6000.0/Documentation/Manual/stack-trace.html), Unity will include the stack traces with the log messages as raw strings. The SDK is able to parse and display this stack trace in the issues details. |
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.
If [configured](https://docs.unity3d.com/6000.0/Documentation/Manual/stack-trace.html), Unity will include the stack traces with the log messages as raw strings. The SDK is able to parse and display this stack trace in the issues details. | |
If [configured](https://docs.unity3d.com/6000.0/Documentation/Manual/stack-trace.html), Unity will include the stack traces with the log messages as raw strings. The Sentry SDK is able to parse and display this stack trace in the issue details page. |
|
||
If [configured](https://docs.unity3d.com/6000.0/Documentation/Manual/stack-trace.html), Unity will include the stack traces with the log messages as raw strings. The SDK is able to parse and display this stack trace in the issues details. | ||
|
||
If you're using Unity 6 or newer, you have the option to to enable the source code line numbers in the [player settings](https://docs.unity3d.com/6000.0/Documentation/Manual/il2cpp-managed-stack-traces.html). These line numbers are then part of the stringified stack trace and will be parsed by the SDK. Unfortunately, since there is no native exception at the time of logging, the SDK is not be able to provide line numbers otherwise. |
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.
If you're using Unity 6 or newer, you have the option to to enable the source code line numbers in the [player settings](https://docs.unity3d.com/6000.0/Documentation/Manual/il2cpp-managed-stack-traces.html). These line numbers are then part of the stringified stack trace and will be parsed by the SDK. Unfortunately, since there is no native exception at the time of logging, the SDK is not be able to provide line numbers otherwise. | |
If you're using Unity 6 or newer, you have the option to to enable the source code line numbers in the [player settings](https://docs.unity3d.com/6000.0/Documentation/Manual/il2cpp-managed-stack-traces.html). These line numbers are then part of the stringified stack trace and will be parsed by the SDK. In order to get line number for log messages, this option must be turned on. For `Log.LogException`, this option isn't required since Sentry can [symbolicate server-side](/platforms/unity/configuration/il2cpp/) the stack trace and add line mumbers. |
|
||
<Alert> | ||
|
||
The Unity SDK does not provide stack traces for messages. |
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.
Flip it around by saying what we do have, to help clarify what we don't.
The Unity SDK does not provide stack traces for messages. | |
The Sentry SDK for Unity only provides stack traces for captured Exceptions. Logged messages won't have line numbers. |
No description provided.