File tree Expand file tree Collapse file tree 3 files changed +9
-2
lines changed Expand file tree Collapse file tree 3 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -1043,6 +1043,13 @@ def start_transaction(
10431043 sampling_context .update (custom_sampling_context )
10441044 transaction ._set_initial_sampling_decision (sampling_context = sampling_context )
10451045
1046+ # update the sample rate in the dsc
1047+ propagation_context = self .get_active_propagation_context ()
1048+ if propagation_context :
1049+ dsc = propagation_context .dynamic_sampling_context
1050+ if dsc is not None :
1051+ dsc ["sample_rate" ] = str (transaction .sample_rate )
1052+
10461053 if transaction .sampled :
10471054 profile = Profile (
10481055 transaction .sampled , transaction ._start_timestamp_monotonic_ns
Original file line number Diff line number Diff line change @@ -378,7 +378,7 @@ def __init__(
378378 self .parent_sampled = parent_sampled
379379 """Boolean indicator if the parent span was sampled.
380380 Important when the parent span originated in an upstream service,
381- because we watn to sample the whole trace, or nothing from the trace."""
381+ because we want to sample the whole trace, or nothing from the trace."""
382382
383383 self .dynamic_sampling_context = dynamic_sampling_context
384384 """Data that is used for dynamic sampling decisions."""
Original file line number Diff line number Diff line change @@ -211,7 +211,7 @@ def test_passes_parent_sampling_decision_in_sampling_context(
211211 assert sampling_context ["parent_sampled" ]._mock_wraps is parent_sampling_decision
212212
213213
214- def test_passes_custom_samling_context_from_start_transaction_to_traces_sampler (
214+ def test_passes_custom_sampling_context_from_start_transaction_to_traces_sampler (
215215 sentry_init , DictionaryContaining # noqa: N803
216216):
217217 traces_sampler = mock .Mock ()
You can’t perform that action at this time.
0 commit comments