Skip to content

feat(sentry): Keep only a fraction of the traces that callers sampled - #8469

Draft
shellmayr wants to merge 2 commits into
masterfrom
shellmayr/feat/sdk-inherited-trace-sample-rate
Draft

shellmayr wants to merge 2 commits into
masterfrom
shellmayr/feat/sdk-inherited-trace-sample-rate

Conversation

@shellmayr

Copy link
Copy Markdown
Member
  • Move the Snuba project's sampling rules into the SDK with a traces_sampler, from the earlier closed PR feat(sentry): Replace the flat trace sample rate with a traces sampler #8445.
  • Keep a caller-sampled trace at SENTRY_INHERITED_TRACE_SAMPLE_RATE, default 0.1. This is the main lever on the Snuba project volume, since 96% of its transactions inherit a decision from the Sentry backend.
  • Decide by trace id, so every Snuba request of one trace gets the same answer, with the same bucketing Sentry uses in its own transport.
  • Traces that start in Snuba keep SENTRY_TRACE_SAMPLE_RATE. Health checks stay at 0. Development environments stay at 100%.

shellmayr and others added 2 commits September 14, 2026 13:26
The snuba project is moving off server-side dynamic sampling. Move the
sampling rules into the SDK so the client makes the same decisions.

A request that carries a sampling decision from the caller keeps it, so
traces stay complete. Traces that start in snuba use the base rate, a
separate rate for health check requests, and full sampling in
development-style environments. The replay ID boost has no meaning for
snuba and is left out.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G5hviFo9NtMorc77sdcYRC
Nearly all snuba requests carry a sampling decision from the caller, and
the traces_sampler kept every sampled one. That volume is set by the
callers' sample rates, so snuba had no lever of its own on the size of
its project.

Keep a caller-sampled trace at SENTRY_INHERITED_TRACE_SAMPLE_RATE. The
decision is derived from the trace id, so every snuba request of one
trace gets the same answer, and the bucketing matches the one sentry
uses in its transport so both services keep the same traces when they
run with the same rate.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant