Sentry 6.0.0 Transaction Sampling: Should New Projects Default to 0.1% or 1%?
0 reputation · 23 May 2023, 06:57 UTC
0 reputation · 23 May 2023, 06:57 UTC
Sentry’s Transaction Sampling feature was introduced in SDK version 6.0.0. It replaced the hard‑coded 1% default with a configurable rate, requiring developers to specify transactionSampleRate in the SDK or via the Sentry UI. Legacy SDKs (pre‑6.0.0) retain the 1% default if the new key is absent.
transactionSampleRate or rely on the current default of 0.1% (1 in 1000).tracesSampleRate can unintentionally shift the effective rate if the SDK interprets the new key with higher priority.The documentation states that the default for new projects should be 0.1%, but also notes that this may change pending community feedback. It is unclear whether the 1% legacy default should be preserved, replaced, or made optional.
tracesSampleRate to transactionSampleRate across all supported SDKs?For new projects using Sentry 6.0.0+, the definitive default sampling rate should be 0.1% (0.001). While 1% provides a richer data set, a conservative 0.1% default prevents immediate quota exhaustion for high-traffic applications and encourages developers to consciously define their sampling strategy based on their specific request volume.
The shift between 0.1% and 1% creates a ten-fold difference in data ingestion. The following table outlines the likely impact on projects that have not yet migrated their configuration:
| Scenario | Data Volume Impact | Performance Impact |
|---|---|---|
| Shift 1% → 0.1% | Significant decrease in ingested traces; lower cost/quota usage. | Negligible; reduced overhead for SDK reporting. |
| Shift 0.1% → 1% | 10x increase in trace volume; risk of hitting rate limits. | Slight increase in network egress for high-throughput apps. |
transactionSampleRate generally takes precedence over tracesSampleRate if both are present.To ensure consistent sampling behavior across a fleet of SDKs during the transition from tracesSampleRate to transactionSampleRate, follow these steps:
Sentry.init({
tracesSampleRate: 0.01,
transactionSampleRate: 0.01,
});
tracesSampleRate key.Required Diagnostic: To refine this recommendation, please provide the average Requests Per Second (RPS) for your typical new project. If RPS exceeds 1,000, the 0.1% default is mandatory to avoid immediate quota depletion.
Use comments to ask for clarification. Post a solution as an answer.
30,275 reputation · 23 May 2023, 14:42 UTC
While a 0.1% default protects quotas for high-traffic apps, it introduces a significant observability gap for low-traffic or critical administrative endpoints. In environments where specific routes only receive a few hundred requests per day, a 0.1% rate may result in zero traces being captured for days, masking intermittent performance regressions.
To verify if the default rate is too conservative, developers should compare the total request count in their web server logs against the Transactions volume in the Sentry dashboard. If critical paths are under-represented, consider these alternatives:
transactionSampleRate specifically for high-value or low-volume endpoints while keeping the global default at 0.1%.