Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 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
29 changes: 29 additions & 0 deletions docs/platforms/unreal/configuration/options.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,26 @@ The support for screenshot attachment on crash events is limited to Windows and

</ConfigKey>

<ConfigKey name="attach-game-log">

When enabled, game log filr is automatically attached to all events captured if current build configuration allows logging.

This option is turned off by default.

<Alert>

Game log attachments for crash events are not supported on macOS and iOS.

</Alert>

</ConfigKey>

## Hooks

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

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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.
The hooks you set as callbacks will be called and executed on the same thread where the event happened. Note that if the event occurs on a non-game thread during garbage collection then then callback will not be invoked.


<ConfigKey name="before-send">

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.
Expand All @@ -101,6 +117,19 @@ By the time <PlatformIdentifier name="before-send" /> is executed, all scope dat

</ConfigKey>

<ConfigKey name="before-breadcrumb">

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

<Alert>

Currently, hints are supported only on Android.

</Alert>

</ConfigKey>

## Tracing Options

<ConfigKey name="traces-sample-rate">
Expand Down
26 changes: 26 additions & 0 deletions docs/platforms/unreal/enriching-events/breadcrumbs/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,29 @@ The same result can be achieved by calling corresponding function in blueprint:
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**.

![Sentry automatic breadcrumbs](./img/unreal_automatic_breadcrumbs.png)

## Customize Breadcrumbs

SDKs allow you to customize breadcrumbs through the <PlatformIdentifier name="before-breadcrumb" /> hook (the corresponding handler class can be set in the plugin settings).

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`:

```cpp
UCLASS()
class UCustomBeforeBreadcrumbHandler : public USentryBeforeBreadcrumbHandler
{
GENERATED_BODY()

public:
virtual USentryBreadcrumb* HandleBeforeBreadcrumb_Implementation(USentryBreadcrumb* Breadcrumb, USentryHint* Hint)
{
Comment on lines +54 to +55
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
virtual USentryBreadcrumb* HandleBeforeBreadcrumb_Implementation(USentryBreadcrumb* Breadcrumb, USentryHint* Hint)
{
virtual USentryBreadcrumb* HandleBeforeBreadcrumb_Implementation(USentryBreadcrumb* Breadcrumb, USentryHint* Hint)
{

They should have the same indentation, right?

if (Breadcrumb->GetCategory() == "Spammy.Logger")
{
// Discard breadcrumb
return nullptr;
}

return Breadcrumb;
}
};
```
7 changes: 7 additions & 0 deletions docs/platforms/unreal/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ The table below highlights some key differences between different versions of th
| Backend (Windows) | Crashpad | Breakpad | Crashpad |
| `on_crash` hook (Windows) | Supported | Not supported | Supported |
| Sentry CLI ** | Included | Manual download | Included |
| Fast-fail crash capturing | Supported | Not supported | Supported |

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

</Alert>

<Alert>

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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.
To avoid warnings during the build for license versions of Unreal Engine, the `EngineVersion` key is not set in the `Sentry.uplugin` for the `github` package.

I might be reading that wrong tho.


</Alert>

### Installing from Fab

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).
Expand Down