Skip to content

Commit a2dfb35

Browse files
authored
Unreal Engine plugin docs update (#13288)
This PR introduces the following changes to Unreal SDK docs: - Added `beforeBreadcrumb` hook description (getsentry/sentry-unreal#814) - Added [notice](getsentry/sentry-unreal#860 (review)) that hooks can't be invoked during garbage collection in Unreal - Added fast-fail crash capturing to the feature comparison table for different plugin versions (getsentry/sentry-unreal#828) - Added [notice](getsentry/sentry-unreal#812 (comment)) about `EngineVersion` key in the plugin's descriptor file for GitHub package - Added GPU crash dump attachment option (getsentry/sentry-unreal#712)
1 parent b70d8a4 commit a2dfb35

File tree

3 files changed

+77
-1
lines changed

3 files changed

+77
-1
lines changed

docs/platforms/unreal/configuration/options.mdx

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,35 @@ Learn more about enriching events with screenshots in our <PlatformLink to="/enr
9999

100100
<Alert>
101101

102-
The support for screenshot attachment on crash events is limited to Windows and Linux.
102+
Attaching screenshots to crash events is currently not supported on Android.
103+
104+
</Alert>
105+
106+
</ConfigKey>
107+
108+
<ConfigKey name="attach-game-log">
109+
110+
When enabled, game log file is automatically attached to all events captured if the current build configuration allows logging.
111+
112+
This option is turned off by default.
113+
114+
</ConfigKey>
115+
116+
<ConfigKey name="attach-gpu-dump">
117+
118+
When enabled, [Nsight Aftermath](https://developer.nvidia.com/nsight-aftermath) mini-dump file is automatically attached to GPU crash events captured.
119+
120+
This option is turned on by default.
121+
122+
<Alert>
123+
124+
This feature is currently supported only for Nvidia GPUs.
125+
126+
</Alert>
127+
128+
<Alert>
129+
130+
On Windows, capturing GPU crashes requires [modifying the Unreal Engine source code](https://github.com/getsentry/sentry-unreal/issues/673).
103131

104132
</Alert>
105133

@@ -109,6 +137,8 @@ The support for screenshot attachment on crash events is limited to Windows and
109137

110138
These options can be used to hook the SDK in various ways to customize the reporting of events.
111139

140+
The callbacks you set as hooks will be called on the thread where the event happened. If the event occurs on a non-game thread during garbage collection the callback will not be invoked.
141+
112142
<ConfigKey name="before-send">
113143

114144
This function is called with an SDK-specific message or error event object, and can return a modified event object, or `null` to skip reporting the event. This can be used, for instance, for manual PII stripping before sending.
@@ -117,6 +147,19 @@ By the time <PlatformIdentifier name="before-send" /> is executed, all scope dat
117147

118148
</ConfigKey>
119149

150+
<ConfigKey name="before-breadcrumb">
151+
152+
This function is called with an SDK-specific breadcrumb object before the breadcrumb is added to the scope. When nothing is returned from the function, the breadcrumb is dropped. To pass the breadcrumb through, return the first argument, which contains the breadcrumb object.
153+
The callback typically gets a second argument (called a "hint") which contains the original object from which the breadcrumb was created to further customize what the breadcrumb should look like.
154+
155+
<Alert>
156+
157+
Currently, hints are supported only on Android.
158+
159+
</Alert>
160+
161+
</ConfigKey>
162+
120163
## Tracing Options
121164

122165
<ConfigKey name="traces-sample-rate">

docs/platforms/unreal/enriching-events/breadcrumbs/index.mdx

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,29 @@ The same result can be achieved by calling corresponding function in blueprint:
3737
The Unreal Engine SDK can capture certain types of breadcrumbs automatically. Those can be enabled using the Sentry configuration window at **Project Settings > Plugins > Sentry**.
3838
3939
![Sentry automatic breadcrumbs](./img/unreal_automatic_breadcrumbs.png)
40+
41+
## Customize Breadcrumbs
42+
43+
SDKs allow you to customize breadcrumbs through the <PlatformIdentifier name="before-breadcrumb" /> hook (the corresponding handler class can be set in the plugin settings).
44+
45+
This hook is passed an already assembled breadcrumb and, in some SDKs, an optional hint. The function can modify the breadcrumb or decide to discard it entirely by returning `nullptr`:
46+
47+
```cpp
48+
UCLASS()
49+
class UCustomBeforeBreadcrumbHandler : public USentryBeforeBreadcrumbHandler
50+
{
51+
GENERATED_BODY()
52+
53+
public:
54+
virtual USentryBreadcrumb* HandleBeforeBreadcrumb_Implementation(USentryBreadcrumb* Breadcrumb, USentryHint* Hint)
55+
{
56+
if (Breadcrumb->GetCategory() == "Spammy.Logger")
57+
{
58+
// Discard breadcrumb
59+
return nullptr;
60+
}
61+
62+
return Breadcrumb;
63+
}
64+
};
65+
```

docs/platforms/unreal/index.mdx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ The table below highlights some key differences between different versions of th
5656
| Backend (Windows) | Crashpad | Breakpad | Crashpad |
5757
| `on_crash` hook (Windows) | Supported | Not supported | Supported |
5858
| Sentry CLI ** | Included | Manual download | Included |
59+
| Fast-fail crash capturing | Supported | Not supported | Supported |
5960

6061
Legend:
6162
`*`: Recommended version of the SDK
@@ -75,6 +76,12 @@ Currently, this method is available only for C++ UE projects. Blueprint projects
7576

7677
</Alert>
7778

79+
<Alert>
80+
81+
To avoid warnings during the build for licensee versions of Unreal Engine, the `EngineVersion` key is not set in the `Sentry.uplugin` for the `github` package.
82+
83+
</Alert>
84+
7885
### Installing from Fab
7986

8087
Sentry SDK can be downloaded via the [standard installation process](https://dev.epicgames.com/documentation/en-us/unreal-engine/working-with-plugins-in-unreal-engine#installingpluginsfromtheunrealenginemarketplace) from its [Epic Games Fab page](https://www.fab.com/listings/eaa89d9d-8d39-450c-b75f-acee010890a2).

0 commit comments

Comments
 (0)