Skip to content

fix!(core): Distinguish disabled traces sampling strategy#1227

Open
szokeasaurusrex wants to merge 2 commits into
szokeasaurusrex/non-exhaustive-client-optionsfrom
szokeasaurusrex/traces-sampling-strat
Open

fix!(core): Distinguish disabled traces sampling strategy#1227
szokeasaurusrex wants to merge 2 commits into
szokeasaurusrex/non-exhaustive-client-optionsfrom
szokeasaurusrex/traces-sampling-strat

Conversation

@szokeasaurusrex

@szokeasaurusrex szokeasaurusrex commented Jul 7, 2026

Copy link
Copy Markdown
Member

Represent traces sampling as a single strategy enum so that leaving tracing unset is different from explicitly configuring a fixed sample rate of 0.0. This keeps sampler callbacks, fixed rates, and disabled tracing mutually exclusive instead of modeling impossible combinations.

This does not fully implement deferred trace propagation semantics yet. It makes the public API capable of representing the distinction the propagation spec needs, so a future implementation can treat unset tracing config differently from an explicit zero sample rate without another public API change.

Update transaction sampling tests to cover the enum-based behavior, including that disabled tracing never samples even when the transaction context carries an explicit sampling decision.

BREAKING CHANGE: ClientOptions::traces_sample_rate and ClientOptions::traces_sampler fields are replaced by ClientOptions::traces_sampling_strategy.

@szokeasaurusrex szokeasaurusrex requested a review from a team as a code owner July 7, 2026 12:32
@szokeasaurusrex szokeasaurusrex force-pushed the szokeasaurusrex/traces-sampling-strat branch 2 times, most recently from d9beb1d to 1bdc841 Compare July 7, 2026 12:36
Represent traces sampling as a single strategy enum so that leaving tracing unset
is different from explicitly configuring a fixed sample rate of `0.0`. This keeps
sampler callbacks, fixed rates, and disabled tracing mutually exclusive instead
of modeling impossible combinations.

This does not fully implement deferred trace propagation semantics yet. It makes
the public API capable of representing the distinction the propagation spec needs,
so a future implementation can treat unset tracing config differently from an
explicit zero sample rate without another public API change.

Update transaction sampling tests and the changelog for the enum-based behavior,
including that disabled tracing never samples even when the transaction context
carries an explicit sampling decision.

BREAKING CHANGE: `ClientOptions::traces_sample_rate` and `ClientOptions::traces_sampler` fields are replaced by `ClientOptions::traces_sampling_strategy`.
@szokeasaurusrex szokeasaurusrex force-pushed the szokeasaurusrex/traces-sampling-strat branch from d8e15af to b34aaa6 Compare July 8, 2026 13:56
@szokeasaurusrex szokeasaurusrex changed the base branch from master to szokeasaurusrex/non-exhaustive-client-options July 8, 2026 13:57
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