Skip to content

feat!(core): Add event sampling strategy - #1228

Merged
szokeasaurusrex merged 2 commits into
szokeasaurusrex/traces-sampling-stratfrom
szokeasaurusrex/sampling-strat
Jul 21, 2026
Merged

feat!(core): Add event sampling strategy#1228
szokeasaurusrex merged 2 commits into
szokeasaurusrex/traces-sampling-stratfrom
szokeasaurusrex/sampling-strat

Conversation

@szokeasaurusrex

@szokeasaurusrex szokeasaurusrex commented Jul 7, 2026

Copy link
Copy Markdown
Member

Replace the public ClientOptions::sample_rate field with an EventSamplingStrategy enum while preserving the existing sample_rate(...) builder API for fixed-rate event sampling.

This mirrors the traces sampling model added in #1227 and unblocks #1127 by making it possible to add a sampling function variant to EventSamplingStrategy without another public field replacement.

BREAKING CHANGE: Remove the public ClientOptions::sample_rate field. Use ClientOptions::event_sampling_strategy to inspect event sampling configuration, and continue using ClientOptions::sample_rate(...) to configure a fixed sample rate.

References #1127
References #1127

@linear-code

linear-code Bot commented Jul 7, 2026

Copy link
Copy Markdown

RUST-215

@szokeasaurusrex szokeasaurusrex changed the title feat(core): Add event sampling strategy feat!(core): Add event sampling strategy Jul 7, 2026
@szokeasaurusrex
szokeasaurusrex marked this pull request as ready for review July 7, 2026 13:20
@szokeasaurusrex
szokeasaurusrex requested a review from a team as a code owner July 7, 2026 13:20
@szokeasaurusrex
szokeasaurusrex force-pushed the szokeasaurusrex/sampling-strat branch from ea5d131 to 8ce4708 Compare July 8, 2026 13:56

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 8ce4708. Configure here.

Comment thread CHANGELOG.md
Comment thread CHANGELOG.md
@szokeasaurusrex
szokeasaurusrex requested review from Litarnus and giortzisg and removed request for alexander-alderman-webb July 20, 2026 15:07
@szokeasaurusrex
szokeasaurusrex force-pushed the szokeasaurusrex/sampling-strat branch from a32eb15 to ce74a79 Compare July 20, 2026 15:52
@szokeasaurusrex
szokeasaurusrex force-pushed the szokeasaurusrex/sampling-strat branch from ce74a79 to 221c434 Compare July 20, 2026 16:23
Replace the public `ClientOptions::sample_rate` field with an `EventSamplingStrategy` enum while preserving the existing `sample_rate(...)` builder API for fixed-rate event sampling.

This mirrors the traces sampling model and unblocks #1127 by making it possible to add a sampling function variant to `EventSamplingStrategy` without another public field replacement.

BREAKING CHANGE: Remove the public `ClientOptions::sample_rate` field. Use `ClientOptions::event_sampling_strategy` to inspect event sampling configuration, and continue using `ClientOptions::sample_rate(...)` to configure a fixed sample rate.

References [#1127](#1127)
References [RUST-215](https://linear.app/getsentry/issue/RUST-215)
@szokeasaurusrex
szokeasaurusrex force-pushed the szokeasaurusrex/sampling-strat branch from 221c434 to 17bead9 Compare July 20, 2026 16:29
@szokeasaurusrex
szokeasaurusrex merged commit f58e921 into master Jul 21, 2026
35 of 52 checks passed
@szokeasaurusrex
szokeasaurusrex deleted the szokeasaurusrex/sampling-strat branch July 21, 2026 11:21
@github-actions

Copy link
Copy Markdown
Fails
🚫 Please consider adding a changelog entry for the next release.

Instructions and example for changelog

Please add an entry to CHANGELOG.md to the "Unreleased" section. Make sure the entry includes this PR's number.

Example:

## Unreleased

### Features

- Add event sampling strategy ([#1228](https://github.com/getsentry/sentry-rust/pull/1228))

If none of the above apply, you can opt out of this check by adding #skip-changelog to the PR description or adding a skip-changelog label.

Generated by 🚫 dangerJS against 17bead9

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.

3 participants