-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Unreal Engine plugin documentation update (#11625)
- Loading branch information
1 parent
80e393e
commit ac9a141
Showing
23 changed files
with
502 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
--- | ||
title: Sampling | ||
description: "Learn how to configure the volume of error and transaction events sent to Sentry." | ||
sidebar_order: 50 | ||
--- | ||
|
||
Adding Sentry to your app gives you a great deal of very valuable information about errors and performance you wouldn't otherwise get. And lots of information is good -- as long as it's the right information, at a reasonable volume. | ||
|
||
## Sampling Error Events | ||
|
||
To send a representative sample of your errors to Sentry, set the <PlatformIdentifier name="sample-rate" /> option in your SDK configuration to a number between `0` (0% of errors sent) and `1` (100% of errors sent). This is a static rate, which will apply equally to all errors. For example, to sample 25% of your errors: | ||
|
||
<PlatformContent includePath="configuration/sample-rate" /> | ||
|
||
The error sample rate defaults to `1`, meaning all errors are sent to Sentry. | ||
|
||
<Note> | ||
|
||
Changing the error sample rate requires re-deployment. In addition, setting an SDK sample rate limits visibility into the source of events. Setting a rate limit for your project (which only drops events when volume is high) may better suit your needs. | ||
|
||
</Note> | ||
|
||
## Sampling Transaction Events | ||
|
||
We recommend sampling your transactions for two reasons: | ||
|
||
1. Capturing a single trace involves minimal overhead, but capturing traces for _every_ level loaded or _every_ API request may add an undesirable load to your system. | ||
|
||
2. Enabling sampling allows you to better manage the number of events sent to Sentry, so you can tailor your volume to your organization's needs. | ||
|
||
Choose a sampling rate with the goal of finding a balance between performance and volume concerns with data accuracy. You don't want to collect _too_ much data, but you want to collect sufficient data from which to draw meaningful conclusions. If you’re not sure what rate to choose, start with a low value and gradually increase it as you learn more about your traffic patterns and volume. | ||
|
||
## Configuring the Transaction Sample Rate | ||
|
||
The Sentry SDKs have two configuration options to control the volume of transactions sent to Sentry, allowing you to take a representative sample: | ||
|
||
1. Uniform sample rate (<PlatformIdentifier name="traces-sample-rate" />): | ||
|
||
- Provides an even cross-section of transactions, no matter where in your app or under what circumstances they occur. | ||
- Uses default [inheritance](#inheritance) and [precedence](#precedence) behavior | ||
|
||
2. Sampling function (<PlatformIdentifier name="traces-sampler" />) which: | ||
- Samples different transactions at different rates | ||
- <PlatformLink to="/configuration/filtering/">Filters</PlatformLink> out some | ||
transactions entirely | ||
- Modifies default [precedence](#precedence) and [inheritance](#inheritance) behavior | ||
|
||
By default, none of these options are set, meaning no transactions will be sent to Sentry. You must set one of the options to start sending transactions. | ||
|
||
### Setting a Uniform Sample Rate | ||
|
||
<PlatformContent includePath="performance/uniform-sample-rate" /> | ||
|
||
### Setting a Sampling Function | ||
|
||
<PlatformContent includePath="performance/sampling-function-intro" /> | ||
|
||
## Sampling Context Data | ||
|
||
### Default Sampling Context Data | ||
|
||
The information contained in the <PlatformIdentifier name="sampling-context" /> object passed to the <PlatformIdentifier name="traces-sampler" /> when a transaction is created varies by platform and integration. | ||
|
||
<PlatformContent includePath="performance/default-sampling-context" /> | ||
|
||
### Custom Sampling Context Data | ||
|
||
When using custom instrumentation to create a transaction, you can add data to the <PlatformIdentifier name="sampling-context" /> by passing it as an optional second argument to <PlatformIdentifier name="start-transaction" />. This is useful if there's data you want the sampler to have access to, but you don't want to attach it to the transaction as `tags` or `data`, such as information that's sensitive or that’s too large to send with the transaction. For example: | ||
|
||
<PlatformContent includePath="performance/custom-sampling-context" /> | ||
|
||
## Inheritance | ||
|
||
Whatever a transaction's sampling decision, that decision will be passed to its child spans and from there to any transactions they subsequently trigger in other services. | ||
|
||
(See <PlatformLink to="/tracing/trace-propagation/">Distributed Tracing</PlatformLink> for more about how that propagation is done.) | ||
|
||
If the transaction currently being created is one of those subsequent transactions (in other words, if it has a parent transaction), the upstream (parent) sampling decision will be included in the sampling context data. Your <PlatformIdentifier name="traces-sampler" /> can use this information to choose whether to inherit that decision. In most cases, inheritance is the right choice, to avoid breaking distributed traces. A broken trace will not include all your services. | ||
|
||
If you're using a <PlatformIdentifier name="traces-sample-rate" /> rather than a <PlatformIdentifier name="traces-sampler" />, the decision will always be inherited. | ||
|
||
## Precedence | ||
|
||
There are multiple ways for a transaction to end up with a sampling decision. | ||
|
||
- Random sampling according to a static sample rate set in <PlatformIdentifier name="traces-sample-rate" /> | ||
- Random sampling according to a sample function rate returned by <PlatformIdentifier name="traces-sampler" /> | ||
- Absolute decision (100% chance or 0% chance) returned by <PlatformIdentifier name="traces-sampler" /> | ||
- If the transaction has a parent, inheriting its parent's sampling decision | ||
- Absolute decision passed to <PlatformIdentifier name="start-transaction" /> | ||
|
||
When there's the potential for more than one of these to come into play, the following precedence rules apply: | ||
|
||
1. If a sampling decision is passed to <PlatformIdentifier name="start-transaction" />, that decision will be used, overriding everything else. | ||
1. If <PlatformIdentifier name="traces-sampler" /> is defined, its decision will be used. It can choose to keep or ignore any parent sampling decision, use the sampling context data to make its own decision, or choose a sample rate for the transaction. We advise against overriding the parent sampling decision because it will break distributed traces | ||
1. If <PlatformIdentifier name="traces-sampler" /> is not defined, but there's a parent sampling decision, the parent sampling decision will be used. | ||
1. If <PlatformIdentifier name="traces-sampler" /> is not defined and there's no parent sampling decision, <PlatformIdentifier name="traces-sample-rate" /> will be used. | ||
|
||
<Alert level="info"> | ||
|
||
Currently there is no support for forcing a sampling decision by passing it into <PlatformIdentifier name="start-transaction" />. | ||
|
||
</Alert> |
Binary file modified
BIN
+239 KB
(290%)
...tforms/unreal/enriching-events/breadcrumbs/img/unreal_automatic_breadcrumbs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
--- | ||
title: Set Up Tracing | ||
description: "Learn how to enable tracing in your app and discover valuable performance insights of your application." | ||
sidebar_order: 4000 | ||
--- | ||
|
||
With [tracing](/product/performance/), Sentry tracks your software performance, measuring metrics like throughput and latency, and displaying the impact of errors across multiple systems. Sentry captures distributed traces consisting of transactions and spans, which measure individual services and individual operations within those services. Learn more about our model in [Distributed Tracing](/product/sentry-basics/tracing/distributed-tracing/). | ||
|
||
<Note> | ||
|
||
If you’re adopting Tracing in a high-throughput environment, we recommend testing prior to deployment to ensure that your service’s performance characteristics maintain expectations. | ||
|
||
</Note> | ||
|
||
## Configure | ||
|
||
First, enable tracing and configure the sample rate for transactions. Set the sample rate for your transactions by either: | ||
|
||
- Setting a uniform sample rate for all transactions using the <PlatformIdentifier name="traces-sample-rate" /> option in your SDK config to a number between `0` and `1`. (For example, to send 20% of transactions, set <PlatformIdentifier name="traces-sample-rate" /> to `0.2`.) | ||
- Controlling the sample rate based on the transaction itself and the context in which it's captured, by providing a function to the <PlatformIdentifier name="traces-sampler" /> config option. | ||
|
||
The two options are meant to be mutually exclusive. If you set both, <PlatformIdentifier name="traces-sampler" /> will take precedence. | ||
|
||
<Alert level="info"> | ||
|
||
Currently there is no support for sampling functions on Windows/Linux (<PlatformIdentifier name="traces-sampler" />). | ||
|
||
</Alert> | ||
|
||
<PlatformContent includePath="performance/configure-sample-rate" /> | ||
|
||
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>. | ||
|
||
## Verify | ||
|
||
Test out tracing by starting and finishing a transaction, which you _must_ do so transactions can be sent to Sentry. Learn how in our <PlatformLink to="/tracing/instrumentation/custom-instrumentation/">Custom Instrumentation</PlatformLink> content. | ||
|
||
While you're testing, set <PlatformIdentifier name="traces-sample-rate" /> to `1.0`, as that ensures that every transaction will be sent to Sentry. Once testing is complete, you may want to set a lower <PlatformIdentifier name="traces-sample-rate" /> value, or switch to using <PlatformIdentifier name="traces-sampler" /> to selectively sample and filter your transactions, based on contextual data. | ||
|
||
## Next Steps | ||
|
||
<PageGrid /> |
19 changes: 19 additions & 0 deletions
19
docs/platforms/unreal/tracing/instrumentation/custom-instrumentation.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--- | ||
title: Custom Instrumentation | ||
description: "Learn how to capture performance data on any action in your app." | ||
sidebar_order: 20 | ||
--- | ||
|
||
<Note> | ||
|
||
To capture transactions and spans customized to your organization's needs, you must first <PlatformLink to="/tracing/">set up tracing.</PlatformLink> | ||
|
||
</Note> | ||
|
||
<PlatformContent includePath="performance/enable-manual-instrumentation" /> | ||
|
||
<PlatformContent includePath="performance/add-spans-example" /> | ||
|
||
## Distributed Tracing | ||
|
||
In order to use distributed tracing, follow the <PlatformLink to="/tracing/trace-propagation/custom-instrumentation/">custom instrumentation</PlatformLink> steps. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
title: Instrumentation | ||
description: "Learn how to instrument tracing in your app." | ||
sidebar_order: 20 | ||
--- | ||
|
||
<PageGrid /> |
6 changes: 6 additions & 0 deletions
6
docs/platforms/unreal/tracing/trace-propagation/custom-instrumentation/index.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
title: Custom Instrumentation | ||
sidebar_order: 40 | ||
--- | ||
|
||
<PlatformContent includePath="distributed-tracing/custom-instrumentation/" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
--- | ||
title: Trace Propagation | ||
description: "Learn how to connect events across applications/services." | ||
sidebar_order: 3000 | ||
--- | ||
|
||
If the overall application landscape that you want to observe with Sentry consists of more than just a single service or application, distributed tracing can add a lot of value. | ||
|
||
## What is Distributed Tracing? | ||
|
||
In the context of tracing events across a distributed system, distributed tracing acts as a powerful debugging tool. Imagine your application as a vast network of interconnected parts. For example, your system might be spread across different servers or your application might split into different backend and frontend services, each potentially having their own technology stack. | ||
|
||
When an error or performance issue occurs, it can be challenging to pinpoint the root cause due to the complexity of such a system. Distributed tracing helps you follow the path of an event as it travels through this intricate web, recording every step it takes. By examining these traces, you can reconstruct the sequence of events leading up to the event of interest, identify the specific components involved, and understand their interactions. This detailed visibility enables you to diagnose and resolve issues more effectively, ultimately improving the reliability and performance of your distributed system. | ||
|
||
## Basic Example | ||
|
||
Here's an example showing a distributed trace in Sentry: | ||
|
||
<Include name="common-imgs/distributed-trace-in-sentry" /> | ||
|
||
This distributed trace shows a Vue app's `pageload` making a request to a Python backend, which then calls the `/api` endpoint of a Ruby microservice. | ||
|
||
What happens in the background is that Sentry uses reads and further propagates two HTTP headers between your applications: | ||
|
||
- `sentry-trace` | ||
- `baggage` | ||
|
||
If you run any JavaScript applications in your distributed system, make sure that those two headers are added to your CORS allowlist and won't be blocked or stripped by your proxy servers, gateways, or firewalls. | ||
|
||
## How to Use Distributed Tracing? | ||
|
||
<PlatformContent includePath="distributed-tracing/how-to-use/" /> | ||
|
||
Remember that in order to propagate trace information through your whole distributed system, you have to use Sentry in all of the involved services and applications. Take a look at their respective SDK docs to learn how distributed tracing can be enabled for each platform. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
```cpp | ||
#include "SentrySettings.h" | ||
|
||
FConfigureSettingsDelegate SettingsDelegate; | ||
SettingsDelegate.BindDynamic(this, &USomeClass::ConfigureSettingsDelegate); | ||
|
||
void USomeClass::ConfigureSettingsDelegate(USentrySettings* Settings) | ||
{ | ||
Settings->SampleRate = 0.25f; | ||
} | ||
|
||
... | ||
|
||
USentrySubsystem* SentrySubsystem = GEngine->GetEngineSubsystem<USentrySubsystem>(); | ||
|
||
SentrySubsystem->InitializeWithSettings(SettingsDelegate); | ||
``` |
Oops, something went wrong.