Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
6 changes: 1 addition & 5 deletions docs/platforms/unreal/metrics/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ With Sentry's [Application Metrics](/product/metrics/), you can send counters, g

## Automatic Metrics

The SDK can automatically collect performance metrics from the engine without any manual instrumentation. All automatic metrics are configured under **Project Settings > Plugins > Sentry > Metrics > Performance** and require **Enable Metrics** to be checked.
The SDK can automatically collect performance metrics from the engine without any manual instrumentation. All automatic metrics are configured under **Project Settings > Plugins > Sentry > Metrics > Performance**.

All automatic metrics include the following attributes for filtering and grouping in Sentry dashboards:

Expand Down Expand Up @@ -54,7 +54,6 @@ To avoid flooding the metrics pipeline, the SDK throttles emission to at most on
```cpp
SentrySubsystem->InitializeWithSettings(FConfigureSettingsNativeDelegate::CreateLambda([=](USentrySettings* Settings)
{
Settings->EnableMetrics = true;
Settings->EnableAutoFrameTimeMetrics = true;
Settings->FrameTimeSampleInterval = 1.0f; // Sample at most once per second (default)
}));
Expand All @@ -77,7 +76,6 @@ GC pauses are a common source of hitches in Unreal Engine games — a single GC
```cpp
SentrySubsystem->InitializeWithSettings(FConfigureSettingsNativeDelegate::CreateLambda([=](USentrySettings* Settings)
{
Settings->EnableMetrics = true;
Settings->EnableAutoGCMetrics = true;
}));
```
Expand All @@ -100,7 +98,6 @@ The **Game stats sample interval** setting controls how often game stats are col
```cpp
SentrySubsystem->InitializeWithSettings(FConfigureSettingsNativeDelegate::CreateLambda([=](USentrySettings* Settings)
{
Settings->EnableMetrics = true;
Settings->EnableAutoGameStatsMetrics = true;
Settings->GameStatsSampleIntervalSeconds = 60; // Sample every 60 seconds (default)
}));
Expand Down Expand Up @@ -145,7 +142,6 @@ The **Network metrics sample interval** setting controls how often network stats
```cpp
SentrySubsystem->InitializeWithSettings(FConfigureSettingsNativeDelegate::CreateLambda([=](USentrySettings* Settings)
{
Settings->EnableMetrics = true;
Settings->EnableAutoNetworkMetrics = true;
Settings->NetworkMetricsSampleInterval = 10; // Poll every 10 seconds (default)
}));
Expand Down
1 change: 0 additions & 1 deletion platform-includes/logs/options/unreal.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ The following configuration options are available for Sentry Logs in Unreal Engi

| Option | Description | Default |
|--------|-------------|------------|
| **Enable Structured Logging** | Master toggle for the structured logging feature | `true` |
| **Enable Debug Logs** | Forward Debug level UE_LOG calls to Sentry | `false` |
| **Enable Info Logs** | Forward Info level UE_LOG calls to Sentry | `false` |
| **Enable Warning Logs** | Forward Warning level UE_LOG calls to Sentry | `false` |
Expand Down
34 changes: 1 addition & 33 deletions platform-includes/logs/setup/unreal.mdx
Original file line number Diff line number Diff line change
@@ -1,28 +1,4 @@
To enable logging in your Unreal Engine project, you need to configure the Sentry SDK with structured logging enabled.

### Project Settings Configuration

1. Open your project settings: **Project Settings > Plugins > Sentry**
2. Check the **Enable Structured Logging** option

### Programmatic Configuration

Alternatively, you can enable logging programmatically when initializing the SDK:

```cpp
#include "SentrySubsystem.h"

void ConfigureSentryWithLogs()
{
USentrySubsystem* SentrySubsystem = GEngine->GetEngineSubsystem<USentrySubsystem>();

// Create settings with logging enabled
SentrySubsystem->InitializeWithSettings(FConfigureSettingsNativeDelegate::CreateLambda([=](USentrySettings* Settings)
{
Settings->EnableStructuredLogging = true;
}));
}
```
Structured logging is enabled by default, so no setup is required to start capturing logs. This page covers the advanced options available for configuring how logs are captured and forwarded.

### Advanced Configuration Options

Expand All @@ -38,8 +14,6 @@ USentrySubsystem* SentrySubsystem = GEngine->GetEngineSubsystem<USentrySubsystem
// Configure automatic log forwarding programmatically
SentrySubsystem->InitializeWithSettings(FConfigureSettingsNativeDelegate::CreateLambda([=](USentrySettings* Settings)
{
Settings->EnableStructuredLogging = true;

// Enable specific severity levels for UE_LOG forwarding
Settings->StructuredLoggingLevels.bOnDebugLog = false;
Settings->StructuredLoggingLevels.bOnInfoLog = true;
Expand All @@ -59,11 +33,8 @@ You can filter which log categories are sent to Sentry:
// Configure category filtering
USentrySubsystem* SentrySubsystem = GEngine->GetEngineSubsystem<USentrySubsystem>();

// Create settings with logging enabled
SentrySubsystem->InitializeWithSettings(FConfigureSettingsNativeDelegate::CreateLambda([=](USentrySettings* Settings)
{
Settings->EnableStructuredLogging = true;

// Only forward logs from specific categories
TArray<FString> AllowedCategories;
AllowedCategories.Add(TEXT("LogGameFlow"));
Expand Down Expand Up @@ -121,9 +92,6 @@ SettingsDelegate.BindDynamic(this, &USomeClass::HandleSettingsDelegate);

void USomeClass::HandleSettingsDelegate(USentrySettings* Settings)
{
// Enable structured logging
Settings->EnableStructuredLogging = true;

// Configure individual severity levels
Settings->StructuredLoggingLevels.bOnDebugLog = false;
Settings->StructuredLoggingLevels.bOnInfoLog = true;
Expand Down
2 changes: 0 additions & 2 deletions platform-includes/metrics/options/unreal.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ The following configuration options are available for Sentry's [Application Metr

| Option | Description | Default |
|--------|-------------|---------|
| **Enable Metrics** | Master toggle for the metrics feature | `true` |
| **Collect frame time metrics** | Automatically emit frame time and per-thread performance metrics. | `false` |
| **Frame time sample interval (seconds)** | How often to sample frame time metrics. | `1.0` |
| **Collect GC pause metrics** | Emit a metric for each garbage collection pause duration. | `false` |
Expand Down Expand Up @@ -41,7 +40,6 @@ Configure the handler in project settings under **Hooks > Custom `beforeMetric`
```cpp
SentrySubsystem->InitializeWithSettings(FConfigureSettingsNativeDelegate::CreateLambda([=](USentrySettings* Settings)
{
Settings->EnableMetrics = true;
Settings->BeforeMetricHandler = UCustomMetricFilter::StaticClass();
}));
```
25 changes: 2 additions & 23 deletions platform-includes/metrics/setup/unreal.mdx
Original file line number Diff line number Diff line change
@@ -1,24 +1,3 @@
To enable metrics in your Unreal Engine project, you need to configure the Sentry SDK with metrics enabled.
Metrics are enabled by default in your Unreal Engine project, so no setup is required to start capturing them.

### Project Settings Configuration

1. Open your project settings: **Project Settings > Plugins > Sentry**
2. Check the **Enable Metrics** option

### Programmatic Configuration

Alternatively, you can enable metrics programmatically when initializing the SDK:

```cpp
#include "SentrySubsystem.h"

void ConfigureSentryWithMetrics()
{
USentrySubsystem* SentrySubsystem = GEngine->GetEngineSubsystem<USentrySubsystem>();

SentrySubsystem->InitializeWithSettings(FConfigureSettingsNativeDelegate::CreateLambda([=](USentrySettings* Settings)
{
Settings->EnableMetrics = true;
}));
}
```
To automatically collect performance metrics from the engine (frame time, GC pauses, game stats, and network), enable the corresponding options under **Project Settings > Plugins > Sentry > Metrics > Performance**.
Loading