Issue
I changed my traces sample rate, but the transactions volume stays the same. Setting the traces sample rate to 0 continues to send transactions to Sentry.
Applies To
- All SaaS Customers and Self-Hosted Users
- Performance Monitoring
Resolution
Setting the traces sample rate to 0.0 does not disable performance monitoring in your application, it simply tells the SDK that spans should not be sent to Sentry. However, there are multiple ways to set the sampling decision, and the traces sample rate option has the lowest priority.
In order to preserve trace and support support distributed tracing, Sentry will use the sampling decision from any parent transaction. This means that if you have performance enabled for your frontend, and a transaction ends up being sampled, the sampling decision will be inherited in the backend, and the backend transaction will be sampled too in order to ensure a fully tracked trace.
You can read more details about inheritance and sampling decision precedence on this page.
The solution to this is to completely turn off performance for your backend project by completely removing the traces sample rate from your init code.
You can also use a trace sampler function to customise if the parent sampling decision should be used or not, or to use a customised sampling decision in your backend project.