From 2397ba481e76d31a1611550e909d853461e1d3a7 Mon Sep 17 00:00:00 2001 From: Ivan Tustanivskyi Date: Fri, 6 Feb 2026 17:35:21 +0200 Subject: [PATCH 1/3] Add initial docs for metrics feature in Unreal SDK --- docs/platforms/unreal/metrics/index.mdx | 34 +++++++++ .../explore/metrics/getting-started/index.mdx | 8 +++ .../metrics/default-attributes/unreal.mdx | 5 ++ platform-includes/metrics/options/unreal.mdx | 42 +++++++++++ .../metrics/requirements/unreal.mdx | 1 + platform-includes/metrics/setup/unreal.mdx | 24 +++++++ platform-includes/metrics/usage/unreal.mdx | 71 +++++++++++++++++++ 7 files changed, 185 insertions(+) create mode 100644 docs/platforms/unreal/metrics/index.mdx create mode 100644 platform-includes/metrics/default-attributes/unreal.mdx create mode 100644 platform-includes/metrics/options/unreal.mdx create mode 100644 platform-includes/metrics/requirements/unreal.mdx create mode 100644 platform-includes/metrics/setup/unreal.mdx create mode 100644 platform-includes/metrics/usage/unreal.mdx diff --git a/docs/platforms/unreal/metrics/index.mdx b/docs/platforms/unreal/metrics/index.mdx new file mode 100644 index 0000000000000..f16f6397a8962 --- /dev/null +++ b/docs/platforms/unreal/metrics/index.mdx @@ -0,0 +1,34 @@ +--- +title: Set Up Metrics +sidebar_title: Metrics +description: "Metrics allow you to send, view and query counters, gauges and distributions from your Unreal Engine applications to track application health and drill down into related traces, logs, and errors." +sidebar_order: 5700 +beta: true +--- + +With Sentry Metrics, you can send counters, gauges, and distributions from your Unreal Engine applications to Sentry. Once in Sentry, these metrics can be viewed alongside relevant errors, and searched using their individual attributes. + + + This feature is currently in open beta. Features in beta are still in progress + and may have bugs. + + +## Requirements + + + +## Setup + + + +## Usage + + + +## Options + + + +## Default Attributes + + diff --git a/docs/product/explore/metrics/getting-started/index.mdx b/docs/product/explore/metrics/getting-started/index.mdx index 14f34f57d6fd6..1e72a070471bb 100644 --- a/docs/product/explore/metrics/getting-started/index.mdx +++ b/docs/product/explore/metrics/getting-started/index.mdx @@ -306,6 +306,14 @@ To set up Sentry Metrics, use the links below for supported SDKs. After it's bee url="/platforms/go/metrics/" /> +### Gaming + +- + ## Upcoming SDKs We're actively working on adding Metrics functionality to additional SDKs. Check out these GitHub issues for the latest updates: diff --git a/platform-includes/metrics/default-attributes/unreal.mdx b/platform-includes/metrics/default-attributes/unreal.mdx new file mode 100644 index 0000000000000..93b3fcdc9c062 --- /dev/null +++ b/platform-includes/metrics/default-attributes/unreal.mdx @@ -0,0 +1,5 @@ +The Unreal Engine SDK automatically attaches the following attributes to every metric: + + + + diff --git a/platform-includes/metrics/options/unreal.mdx b/platform-includes/metrics/options/unreal.mdx new file mode 100644 index 0000000000000..fbfdc3a1ff1e2 --- /dev/null +++ b/platform-includes/metrics/options/unreal.mdx @@ -0,0 +1,42 @@ +The following configuration options are available for Sentry Metrics in Unreal Engine: + +| Option | Description | Default | +|--------|-------------|---------| +| **Enable Metrics** | Master toggle for the metrics feature | `false` | +| **Before Metric Handler** | Handler to modify or filter metrics before sending | None | + +### Before-Metric Handler + +To filter metrics or modify them before they are sent to Sentry, create a custom before-metric handler class: + +```cpp +UCLASS() +class UCustomMetricFilter : public USentryBeforeMetricHandler +{ + GENERATED_BODY() +public: + virtual USentryMetric* HandleBeforeMetric_Implementation(USentryMetric* Metric) override + { + // Drop metrics with specific names + if (Metric->GetName().Contains(TEXT("debug"))) + { + return nullptr; // Return null to prevent sending + } + + // Modify metric attributes + Metric->SetAttribute(TEXT("build"), FSentryVariant(TEXT("production"))); + + return Metric; // Return the metric to send it + } +}; +``` + +Configure the handler in project settings under **Hooks > Custom `beforeMetric` event handler**, or set it programmatically: + +```cpp +SentrySubsystem->InitializeWithSettings(FConfigureSettingsNativeDelegate::CreateLambda([=](USentrySettings* Settings) +{ + Settings->EnableMetrics = true; + Settings->BeforeMetricHandler = UCustomMetricFilter::StaticClass(); +})); +``` diff --git a/platform-includes/metrics/requirements/unreal.mdx b/platform-includes/metrics/requirements/unreal.mdx new file mode 100644 index 0000000000000..01d3946bb9099 --- /dev/null +++ b/platform-includes/metrics/requirements/unreal.mdx @@ -0,0 +1 @@ +Metrics for Unreal Engine are supported in Sentry Unreal Engine SDK version `1.7.0` and above. diff --git a/platform-includes/metrics/setup/unreal.mdx b/platform-includes/metrics/setup/unreal.mdx new file mode 100644 index 0000000000000..a8cfdbfc884fc --- /dev/null +++ b/platform-includes/metrics/setup/unreal.mdx @@ -0,0 +1,24 @@ +To enable metrics in your Unreal Engine project, you need to configure the Sentry SDK with metrics enabled. + +### 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(); + + SentrySubsystem->InitializeWithSettings(FConfigureSettingsNativeDelegate::CreateLambda([=](USentrySettings* Settings) + { + Settings->EnableMetrics = true; + })); +} +``` diff --git a/platform-includes/metrics/usage/unreal.mdx b/platform-includes/metrics/usage/unreal.mdx new file mode 100644 index 0000000000000..7ad3a33c93f1e --- /dev/null +++ b/platform-includes/metrics/usage/unreal.mdx @@ -0,0 +1,71 @@ +Once metrics are enabled, you can emit metrics using the Sentry subsystem. + +### Metric Types + +| Type | Use For | +| -------------- | -------------------------------------------- | +| Counter | Events (orders, clicks, API calls) | +| Gauge | Current values (queue depth, connections) | +| Distribution | Value ranges (response times, payload sizes) | + +### Counters + +Track the number of times something happens: + +```cpp +#include "SentrySubsystem.h" + +USentrySubsystem* SentrySubsystem = GEngine->GetEngineSubsystem(); + +SentrySubsystem->AddCount(TEXT("api.requests"), 1); +``` + +### Gauges + +Track current values that can go up or down: + +```cpp +SentrySubsystem->AddGauge(TEXT("active_connections"), 42, USentryUnitHelper::MakeSentryUnit(ESentryUnit::None)); +``` + +### Distributions + +Track a range of values (e.g., response times): + +```cpp +SentrySubsystem->AddDistribution(TEXT("response.time"), 150.5f, USentryUnitHelper::MakeSentryUnit(ESentryUnit::Millisecond)); +``` + +### Custom Attributes + +Add attributes to filter and group metrics in Sentry: + +```cpp +TMap Attributes; +Attributes.Add(TEXT("endpoint"), FSentryVariant(TEXT("/api/orders"))); +Attributes.Add(TEXT("region"), FSentryVariant(TEXT("us-west"))); + +SentrySubsystem->AddCountWithAttributes(TEXT("api.calls"), 1, Attributes); +``` + +All metric methods have a `WithAttributes` variant: +- `AddCountWithAttributes()` +- `AddDistributionWithAttributes()` +- `AddGaugeWithAttributes()` + +### Units + +For gauge and distribution metrics, specify a unit to help Sentry display values in a human-readable format. The SDK provides the `ESentryUnit` enum with predefined units for duration, information, and fraction categories: + +```cpp +// Using predefined units +SentrySubsystem->AddGauge(TEXT("memory.usage"), 1024.0f, USentryUnitHelper::MakeSentryUnit(ESentryUnit::Byte)); +SentrySubsystem->AddDistribution(TEXT("latency"), 42.5f, USentryUnitHelper::MakeSentryUnit(ESentryUnit::Millisecond)); + +// Using a custom unit +SentrySubsystem->AddDistribution(TEXT("frame.rate"), 60.0f, USentryUnitHelper::MakeSentryCustomUnit(TEXT("fps"))); +``` + +### Blueprint Support + +You can also emit metrics from Blueprints by calling the **Add Count**, **Add Distribution**, or **Add Gauge** nodes on the Sentry subsystem. Use the **Make Sentry Unit** node to specify measurement units. From afec0b54a2fdc2ad37cd80b14b34777339d99ece Mon Sep 17 00:00:00 2001 From: Ivan Tustanivskyi Date: Fri, 6 Feb 2026 18:02:25 +0200 Subject: [PATCH 2/3] Change header text --- docs/platforms/unreal/metrics/index.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/platforms/unreal/metrics/index.mdx b/docs/platforms/unreal/metrics/index.mdx index f16f6397a8962..482d094644a53 100644 --- a/docs/platforms/unreal/metrics/index.mdx +++ b/docs/platforms/unreal/metrics/index.mdx @@ -1,12 +1,12 @@ --- title: Set Up Metrics sidebar_title: Metrics -description: "Metrics allow you to send, view and query counters, gauges and distributions from your Unreal Engine applications to track application health and drill down into related traces, logs, and errors." +description: "Metrics allow you to send, view and query counters, gauges and distributions from your Unreal Engine game to track application health and drill down into related traces, logs, and errors." sidebar_order: 5700 beta: true --- -With Sentry Metrics, you can send counters, gauges, and distributions from your Unreal Engine applications to Sentry. Once in Sentry, these metrics can be viewed alongside relevant errors, and searched using their individual attributes. +With Sentry Metrics, you can send counters, gauges, and distributions from your Unreal Engine game to Sentry. Once in Sentry, these metrics can be viewed alongside relevant errors, and searched using their individual attributes. This feature is currently in open beta. Features in beta are still in progress From c2380879cde4d2dd97a3f940fb329ab7f8eb31db Mon Sep 17 00:00:00 2001 From: Ivan Tustanivskyi Date: Fri, 6 Feb 2026 18:08:20 +0200 Subject: [PATCH 3/3] Fix highlight --- platform-includes/metrics/usage/unreal.mdx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/platform-includes/metrics/usage/unreal.mdx b/platform-includes/metrics/usage/unreal.mdx index 7ad3a33c93f1e..c67b2aab30b06 100644 --- a/platform-includes/metrics/usage/unreal.mdx +++ b/platform-includes/metrics/usage/unreal.mdx @@ -4,9 +4,9 @@ Once metrics are enabled, you can emit metrics using the Sentry subsystem. | Type | Use For | | -------------- | -------------------------------------------- | -| Counter | Events (orders, clicks, API calls) | -| Gauge | Current values (queue depth, connections) | -| Distribution | Value ranges (response times, payload sizes) | +| `Counter` | Events (orders, clicks, API calls) | +| `Gauge` | Current values (queue depth, connections) | +| `Distribution` | Value ranges (response times, payload sizes) | ### Counters