From ef23e37e4c204d4642cb16b58e7372f7209c8e55 Mon Sep 17 00:00:00 2001 From: Ivan Tustanivskyi Date: Wed, 27 Aug 2025 16:04:30 +0300 Subject: [PATCH 1/2] Update sampling docs --- docs/platforms/unreal/configuration/options.mdx | 6 ------ docs/platforms/unreal/tracing/index.mdx | 6 ------ .../performance/traces-sampler-as-sampler/unreal.mdx | 2 +- 3 files changed, 1 insertion(+), 13 deletions(-) diff --git a/docs/platforms/unreal/configuration/options.mdx b/docs/platforms/unreal/configuration/options.mdx index 6b71720b5ece7..864e27b2db487 100644 --- a/docs/platforms/unreal/configuration/options.mdx +++ b/docs/platforms/unreal/configuration/options.mdx @@ -186,10 +186,4 @@ A number between `0` and `1`, controlling the percentage chance a given transact A function responsible for determining the percentage chance a given transaction will be sent to Sentry. It will automatically be passed information about the transaction and the context in which it's being created, and must return a number between `0` (0% chance of being sent) and `1` (100% chance of being sent). Can also be used for filtering transactions, by returning 0 for those that are unwanted. Either this or must be defined to enable tracing. - - -Currently, there is no support for sampling functions on Windows or Linux (). - - - diff --git a/docs/platforms/unreal/tracing/index.mdx b/docs/platforms/unreal/tracing/index.mdx index 3fa95d300ffab..1701a03dcec62 100644 --- a/docs/platforms/unreal/tracing/index.mdx +++ b/docs/platforms/unreal/tracing/index.mdx @@ -22,12 +22,6 @@ First, enable tracing and configure the sample rate for transactions. Set the sa The two options are meant to be mutually exclusive. If you set both, will take precedence. - - -Currently there is no support for sampling functions on Windows/Linux (). - - - Learn more about tracing options, how to use the TracesSampler function, or how to sample transactions. diff --git a/platform-includes/performance/traces-sampler-as-sampler/unreal.mdx b/platform-includes/performance/traces-sampler-as-sampler/unreal.mdx index 58843aff2796c..e37cfaeb7d6b9 100644 --- a/platform-includes/performance/traces-sampler-as-sampler/unreal.mdx +++ b/platform-includes/performance/traces-sampler-as-sampler/unreal.mdx @@ -7,7 +7,7 @@ class USomeTraceSampler : public USentryTraceSampler public: virtual bool Sample_Implementation(USentrySamplingContext* samplingContext, float& samplingValue) override { - const FString& gameMode = + const FSentryVariant& gameMode = *samplingContext->GetCustomSamplingContext().Find("GameMode"); if (gameMode.Equals(TEXT("ranked"))) From c5b1d23908cf2a8de972c6fc7a992c7804a424d1 Mon Sep 17 00:00:00 2001 From: Ivan Tustanivskyi Date: Thu, 28 Aug 2025 16:58:22 +0300 Subject: [PATCH 2/2] Fix example code --- .../performance/traces-sampler-as-sampler/unreal.mdx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/platform-includes/performance/traces-sampler-as-sampler/unreal.mdx b/platform-includes/performance/traces-sampler-as-sampler/unreal.mdx index e37cfaeb7d6b9..78123d3155588 100644 --- a/platform-includes/performance/traces-sampler-as-sampler/unreal.mdx +++ b/platform-includes/performance/traces-sampler-as-sampler/unreal.mdx @@ -10,17 +10,17 @@ public: const FSentryVariant& gameMode = *samplingContext->GetCustomSamplingContext().Find("GameMode"); - if (gameMode.Equals(TEXT("ranked"))) + if (gameMode.GetValue().Equals(TEXT("ranked"))) { // Ranked matches are important - take a big sample samplingValue = 0.5; } - else if (gameMode.Equals(TEXT("quick_match"))) + else if (gameMode.GetValue().Equals(TEXT("quick_match"))) { // Quick matches less important and happen more frequently - only take 20% samplingValue = 0.2; } - else if (gameMode.Equals(TEXT("training"))) + else if (gameMode.GetValue().Equals(TEXT("training"))) { // Training matches are just noise - drop all transactions samplingValue = 0.0;