|
| 1 | +--- |
| 2 | +title: Getting Started |
| 3 | +sidebar_order: 10 |
| 4 | +description: "Learn how to get started with server-side sampling." |
| 5 | +--- |
| 6 | + |
| 7 | +<Note> |
| 8 | + |
| 9 | +This feature is in beta and is only available if your organization is participating in its limited release. Features in beta are still in-progress and may have bugs. We recognize the irony. If you’re interested in participating, [join the waitlist](https://sentry.io/for/performance/#updates-signup). |
| 10 | + |
| 11 | +</Note> |
| 12 | + |
| 13 | +<Note> |
| 14 | + |
| 15 | +To set up or configure server-side sampling, you need to be an Owner, Manager, or Admin of your Sentry organization. |
| 16 | + |
| 17 | +</Note> |
| 18 | + |
| 19 | +## Current Limitations |
| 20 | + |
| 21 | +Server-side sampling is currently only available for the following SDK's: |
| 22 | + |
| 23 | +- Python: 1.7.2 or later |
| 24 | +- JavaScript: 7.6.0 or later |
| 25 | +- Apple: 7.23.0 or later |
| 26 | +- Android: 6.2.1 or later |
| 27 | + |
| 28 | +If your application relies on any Sentry SDK that isn't specified above, then you won’t be able to use server-side sampling. |
| 29 | + |
| 30 | +There are other limitations that you should be aware of when setting up server-side sampling: |
| 31 | + |
| 32 | +- [Trace rules can only select based on the attributes of the initial transaction](/product/data-management-settings/server-side-sampling/current-limitations/#trace-rules-can-only-select-based-on-the-attributes-of-the-initial-transaction) |
| 33 | +- [Changing trace attributes in secondary transactions](/product/data-management-settings/server-side-sampling/current-limitations/#changing-trace-attributes-in-secondary-transactions) |
| 34 | +- [Limited number of rule conditions](/product/data-management-settings/server-side-sampling/current-limitations/#limited-number-of-rule-conditions) |
| 35 | +- [Arbitrary logical composition for rule conditions](/product/data-management-settings/server-side-sampling/current-limitations/#arbitrary-logical-composition-for-rule-conditions) |
| 36 | + |
| 37 | +For more detailed information about each of these, check out our [full Current Limitations documentation](/product/data-management-settings/server-side-sampling/current-limitations/). |
| 38 | + |
| 39 | +## 1. Update Sentry SDK Versions |
| 40 | + |
| 41 | +Once you’ve confirmed that your application only relies on [supported SDKs](#current-limitations), then the next step is to update them to the specified version or higher. Check out the migration documentation for the [SDKs](/platforms/) you’re using to learn everything you need to know to get up and running again with the latest Sentry features. |
| 42 | + |
| 43 | +## 2. Set a Uniform Sampling Rate |
| 44 | + |
| 45 | +Next, go to **[Project] > Settings > Server-side Sampling** in [sentry.io](https://sentry.io) and set a uniform sampling rate for all transactions: this is the number of transactions that Sentry should accept from your application: |
| 46 | + |
| 47 | + |
| 48 | + |
| 49 | +Based on your quota and usage, in this step, we’ll suggest sampling rates for both Sentry servers and your Sentry SDK. However, you can enter a custom sampling rate by overriding our recommended values. For example, you can select your current sampling rates to understand how our proposed sampling configuration would impact your transaction volume within the scope of this project. Learn more about [How Sentry Samples](/product/data-management-settings/server-side-sampling/#how-sentry-samples). |
| 50 | + |
| 51 | +The numbers you enter in the “Client” field do not affect your actual SDK sample rate, but if you click “Next” and save, the number you’ve entered in the “Server” field on the “Suggested” row is saved as your uniform server-side sampling rate. |
| 52 | + |
| 53 | +Even though you’ll only set this for one project/SDK, **this rate can affect all the transactions distributed across multiple services**, including other projects set up in Sentry. That’s because server-side currently samples by the context of all other transactions belonging to the same trace. Check out our [full Tracing documentation](/product/sentry-basics/tracing/) for a more detailed explanation. |
| 54 | + |
| 55 | +If this chart doesn’t provide enough information for you to determine a uniform sampling rate for this project, we recommend checking your **Stats** page. The **Stats** page provides a complete overview of how many transactions each project accepts, filters, and drops rather than for just one project. |
| 56 | + |
| 57 | +Once you've entered a uniform sample rate for all transactions, now you need to activate it by clicking “Done” and then toggling the rule to on: |
| 58 | + |
| 59 | + |
| 60 | + |
| 61 | +## 3. Set a Sampling Rate Based on a Condition |
| 62 | + |
| 63 | +Now, click “Add Rule” to set more sampling rules based on specific conditions. These rules will help you target the transactions you want to keep and allow you to have more of those transactions sent by the SDK. |
| 64 | + |
| 65 | +When a rule uses multiple conditions, we use the logical expression `AND` to determine when that rule should be evaluated. Multiple values for a condition use a logical or condition for matching. Learn more about [how to create effective server-side sampling rules](/product/data-management-settings/server-side-sampling/#server-side-sampling-configurations). |
| 66 | + |
| 67 | +You can use the following conditions to sample transactions by: |
| 68 | + |
| 69 | +- Environment |
| 70 | +- Release\* |
| 71 | + |
| 72 | +\* Allows glob pattern matching |
| 73 | + |
| 74 | + |
| 75 | + |
| 76 | +If we've accepted a transaction which contains a key-value pair matching the above conditions in the past, Sentry will suggest values for each condition. Of course, you're free to set a custom value for each condition. Then, specify a sampling rate for that specific rule. |
| 77 | + |
| 78 | +## 4. Increase Your SDK Transaction Sample Rate |
| 79 | + |
| 80 | +Generally speaking, the more active sampling rules you have, the fewer transactions we'll accept. If the volume of transactions our servers are receiving is insufficient given the rules you've specified, you might need to increase the sampling rate configured for your Sentry SDK. To see what we would suggest for your SDK sample rate, go to **[Project] > Settings > Server-side Sampling** and open the last rule in the list, which is where your uniform sample rate is set. Our suggestion is displayed there. |
| 81 | + |
0 commit comments