Skip to content

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

Open
szokeasaurusrex wants to merge 3 commits into
szokeasaurusrex/traces-sampling-stratfrom
szokeasaurusrex/sampling-strat
Open

feat!(core): Add event sampling strategy#1228
szokeasaurusrex wants to merge 3 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 RUST-215

@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
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/traces-sampling-strat branch from d8e15af to b34aaa6 Compare July 8, 2026 13:56
@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 Outdated
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