Skip to content

Commit e3632ae

Browse files
authored
Unreal Engine: Update sampling docs (#14740)
This PR updates `Sampling` section for Unreal SDK docs: - Removed notice that trace sampling function is not supported on Windows and Linux - Updated custom trace sampler example Related to: - getsentry/sentry-unreal#1057
1 parent 9881ece commit e3632ae

File tree

3 files changed

+4
-16
lines changed

3 files changed

+4
-16
lines changed

docs/platforms/unreal/configuration/options.mdx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -186,10 +186,4 @@ A number between `0` and `1`, controlling the percentage chance a given transact
186186

187187
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 <PlatformIdentifier name="traces-sample-rate" /> must be defined to enable tracing.
188188

189-
<Alert>
190-
191-
Currently, there is no support for sampling functions on Windows or Linux (<PlatformIdentifier name="traces-sampler" />).
192-
193-
</Alert>
194-
195189
</ConfigKey>

docs/platforms/unreal/tracing/index.mdx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,6 @@ First, enable tracing and configure the sample rate for transactions. Set the sa
2222

2323
The two options are meant to be mutually exclusive. If you set both, <PlatformIdentifier name="traces-sampler" /> will take precedence.
2424

25-
<Alert>
26-
27-
Currently there is no support for sampling functions on Windows/Linux (<PlatformIdentifier name="traces-sampler" />).
28-
29-
</Alert>
30-
3125
<PlatformContent includePath="performance/configure-sample-rate" />
3226

3327
Learn more about tracing <PlatformLink to="/configuration/options/#tracing-options">options</PlatformLink>, how to use the <PlatformLink to="/configuration/sampling/#setting-a-sampling-function">TracesSampler</PlatformLink> function, or how to <PlatformLink to="/configuration/sampling/#sampling-transaction-events">sample transactions</PlatformLink>.

platform-includes/performance/traces-sampler-as-sampler/unreal.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,20 @@ class USomeTraceSampler : public USentryTraceSampler
77
public:
88
virtual bool Sample_Implementation(USentrySamplingContext* samplingContext, float& samplingValue) override
99
{
10-
const FString& gameMode =
10+
const FSentryVariant& gameMode =
1111
*samplingContext->GetCustomSamplingContext().Find("GameMode");
1212

13-
if (gameMode.Equals(TEXT("ranked")))
13+
if (gameMode.GetValue<FString>().Equals(TEXT("ranked")))
1414
{
1515
// Ranked matches are important - take a big sample
1616
samplingValue = 0.5;
1717
}
18-
else if (gameMode.Equals(TEXT("quick_match")))
18+
else if (gameMode.GetValue<FString>().Equals(TEXT("quick_match")))
1919
{
2020
// Quick matches less important and happen more frequently - only take 20%
2121
samplingValue = 0.2;
2222
}
23-
else if (gameMode.Equals(TEXT("training")))
23+
else if (gameMode.GetValue<FString>().Equals(TEXT("training")))
2424
{
2525
// Training matches are just noise - drop all transactions
2626
samplingValue = 0.0;

0 commit comments

Comments
 (0)