When there's the potential for more than one of these to come into play, the following precedence rules apply: Absolute decision passed to StartTransaction.If the transaction has a parent, inheriting its parent's sampling decision.Absolute decision (100% chance or 0% chance) returned by TracesSampler.Random sampling according to a sample function rate returned by TracesSampler.Random sampling according to a static sample rate set in TracesSampleRate.There are multiple ways for a transaction to end up with a sampling decision. Type m圜ontextKey struct, ) // If the transaction was already started, for example in an HTTP handler: Modifies default precedence and inheritance behavior.Samples different transactions at different rates.Sampling function ( TracesSampler) which: Uses default inheritance and precedence behavior.Provides an even cross-section of transactions, no matter where in your app or under what circumstances they occur.The Sentry SDKs have two configuration options to control the volume of transactions sent to Sentry, allowing you to take a representative sample: 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. You don't want to collect too much data, but you want to collect sufficient data from which to draw meaningful conclusions. 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.Ĭhoose a sampling rate with the goal of finding a balance between performance and volume concerns with data accuracy.Capturing a single trace involves minimal overhead, but capturing traces for every page load or every API request may add an undesirable load to your system.We recommend sampling your transactions for two reasons: Setting a rate limit for your project (which only drops events when volume is high) may better suit your needs. In addition, setting an SDK sample rate limits visibility into the source of events. Changing the error sample rate requires re-deployment.
0 Comments
Leave a Reply. |