Sentry Performance Quotas Blew Up Our Budget: How We Tamed Transaction Volume
We burned through a year of Sentry performance quota in six weeks. Here's what actually caused it, what the dashboards didn't show us, and the sampling rules that brought the bill back under control.
We signed a Sentry contract in January sized for the previous year's traffic. By mid-February the performance quota was 80% consumed and the account manager was emailing us about an overage. The error quota was fine. It was transactions — the thing we'd quietly enabled across three services without thinking hard about it — that was eating the budget.
This is the write-up we wish we'd had before turning on Performance. It's not a hit piece on Sentry; the product is good and we still use it. It's a breakdown of how transaction volume behaves in the wild, which sampling strategies actually move the needle, and the specific mistakes that cost us money.
Why transaction volume is not what you think it is
When you enable Sentry Performance in a Next.js or Node service, every incoming request becomes a transaction. Every outgoing HTTP call, DB query, and queue job becomes a span inside that transaction. The pricing unit is the transaction, not the span, which sounds forgiving until you actually count requests.
A mid-sized API doing 150 RPS sustained is roughly 13 million transactions per day. At tracesSampleRate: 1.0 that's ~390M transactions a month from one service. Sentry's default plans are measured in single-digit or low-double-digit millions. The math breaks immediately.
The common first instinct is to drop tracesSampleRate to something like 0.1. That works for the bill but creates a new problem: your p99 latency investigations become statistically useless on low-traffic endpoints, and errors stop having traces attached to them because the trace got sampled out before the error happened.
What the Sentry dashboard didn't make obvious
Two things caught us off guard:
- Health check endpoints were the single biggest source. Our ALB and Kubernetes liveness probes were hitting
/healthzevery few seconds per pod. With 40 pods across environments, that was ~700k transactions per day doing absolutely nothing useful. - Background jobs counted as transactions too. A queue worker processing 2M jobs a day was 2M transactions, and most were sub-10ms no-ops where the job was a dedupe check that exited early.
Neither showed up at the top of the "slowest transactions" view because they were fast. They only showed up when we sorted by volume, which we hadn't thought to do.
The sampling model we settled on
After two weeks of iteration, we landed on a tracesSampler function rather than a flat rate. The logic is boring but it works:
import * as Sentry from '@sentry/node';
Sentry.init({
dsn: process.env.SENTRY_DSN,
tracesSampler: (ctx) => {
const name = ctx.transactionContext.name;
const op = ctx.transactionContext.op;
// Never trace infra noise
if (name === 'GET /healthz' || name === 'GET /ready') return 0;
if (name?.startsWith('GET /_next/static')) return 0;
// Always trace anything with an active error
if (ctx.parentSampled === true) return 1;
// High-value routes: checkout, auth, payments
if (name?.match(/\/(checkout|auth|payments)/)) return 0.5;
// Background jobs: sample heavily, keep the slow ones via profiling
if (op === 'queue.task') return 0.02;
// Everything else
return 0.1;
},
profilesSampleRate: 0.1,
});
A few things worth calling out:
parentSampled === truemeans a trace that started upstream (e.g. from a browser SDK that decided to sample) continues to be sampled through the backend. This keeps distributed traces intact instead of leaving holes.- The 0.02 rate on queue tasks was aggressive but defensible — queue workers have their own metrics in our Grafana stack, and we only really need Sentry when something throws.
- We did not rely on
ignoreTransactionsfor health checks because it still counts toward the SDK's internal processing budget. Returning0from the sampler is cheaper.
Dynamic sampling on the server side
Sentry also applies server-side dynamic sampling on top of what the SDK sends. In our experience the server-side rules are useful for coarse per-project limits but they don't replace a sensible tracesSampler. If your SDK sends 100M transactions a month and the server throws 90% away, you still paid the ingest cost on the SDK side (CPU, memory, network) for traces that will never be visible. Sample at the source.
The error-without-trace problem
Once we dropped the sample rate, we noticed a new annoyance: errors in production often had no associated trace. The trace had been sampled out milliseconds before the exception fired. For a payment failure on an endpoint we care about, this is unacceptable.
The fix is a two-parter:
- Use
tracesSampler(nottracesSampleRate) so you can bias toward routes that matter. - For truly critical paths, wrap the handler in an explicit transaction with
forceTransaction: trueor useSentry.startSpanwith a sampling decision of1.
export async function POST(req: Request) {
return Sentry.startSpan(
{ name: 'checkout.submit', op: 'http.server', forceTransaction: true },
async () => {
// handler logic
}
);
}
This is a sledgehammer — use it on maybe 5–10 endpoints across a whole service, not everywhere.
What this actually did to the bill
We can't publish exact invoices but the shape of the change was:
- Monthly transaction volume dropped by roughly 85%.
- Error-to-trace linkage rate on critical routes went from ~30% to ~95% because we stopped sampling them so aggressively.
- Mean time to diagnose a p99 regression on checkout actually improved, because the traces we kept were the ones that mattered.
- Total Sentry spend landed at roughly 30% of the pre-sampling projection, with headroom for traffic growth.
The counterintuitive lesson: we got better observability by collecting less data, because the signal-to-noise ratio on what we did collect was higher.
Where OpenTelemetry fits
A question we get often: should you ditch the Sentry SDK and send OTel traces to Sentry instead? Sentry supports OTLP ingest now, and the appeal is a single instrumentation layer feeding Sentry, Grafana Tempo, and anything else.
Our take after trying it on two services:
- The OTel bridge works, but you lose some of the Sentry-native UX around linking errors to traces automatically. The linkage is there if you set
sentry-traceandbaggageheaders correctly, but it's extra work. - Sampling decisions move into your OTel collector config, which is more powerful but also more rope to hang yourself with. A bad
tail_sampling_processorrule can silently drop everything. - Cost-wise it's roughly neutral if you're sending the same volume. The win is architectural, not financial.
If you're greenfield and committed to OTel everywhere, go that route. If you're already deep in the Sentry SDK and your team is shipping features, the native SDK with a smart tracesSampler is less disruptive.
Things we'd flag to anyone enabling Performance for the first time
- Count your requests per second per service before you set a sample rate. Multiply by 2.6M (seconds per month) and see what the raw number looks like. It will surprise you.
- Exclude health checks, static asset requests, and metrics scrape endpoints at the sampler level. These have no diagnostic value and dominate volume.
- Treat background jobs as a separate category. They have different value-per-trace than user-facing requests.
- Set a quota alert at 50% of monthly allocation, not 80%. Transaction volume is lumpy and a traffic spike late in the month can blow the budget before you can react.
- Review the "Transactions by volume" view monthly. New endpoints get added, instrumentation creeps in, and what was 10% of your volume last quarter might be 40% this quarter.
Where we'd start
If you're already over quota or about to be, do this in order: pull up the transactions-by-volume view, identify the top five by count (not by latency), and figure out which of those are infra noise versus actual user traffic. Drop the noise to zero in a tracesSampler. Then set a flat 0.1 on everything else, bump critical routes back up to 0.5, and watch the numbers for a week before tuning further.
If you're setting up Performance for the first time, don't enable it with tracesSampleRate: 1.0 even in staging. The habits you form in staging — and the quota consumption patterns — will follow you to prod. Start at 0.1 with a sampler function skeleton already in place, and raise individual routes as you need them.
If you want a hand auditing your observability stack or sizing it before you commit to a contract, that's the kind of thing our DevOps and cloud team does regularly.
Want a team like ours?
72Technologies builds production software for the kind of teams who actually read this blog.
Start a projectKeep reading
Pulumi vs Terraform in 2026: A Migration Postmortem
We moved a mid-sized AWS estate from Terraform to Pulumi, then moved part of it back. Here's what the migration actually cost, where Pulumi earned its keep, and where HCL still wins.
Terraform State Locking Failed Mid-Apply: What We Learned About DynamoDB and S3 Backends
A half-applied Terraform run, a stuck DynamoDB lock, and a VPC that almost lost its NAT. Here's how state locking actually fails, and the backend hygiene we wish we'd had six months earlier.
OpenTelemetry Sampling at 100 RPS: What We Keep, What We Drop, and Why
Head sampling is cheap and lies to you. Tail sampling is honest and expensive. Here's the sampling config we actually run in production, and the traces we deliberately throw away.
