Skip to content

Commit c18cdf0

Browse files
committed
misleading comments
1 parent c3d0156 commit c18cdf0

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

sentry_sdk/integrations/opentelemetry/sampler.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,13 +161,11 @@ def _update_trace_state(span_context, sampled, sample_rate=None, sample_rand=Non
161161
elif trace_state.get(TRACESTATE_SAMPLED_KEY) == "deferred":
162162
trace_state = trace_state.update(TRACESTATE_SAMPLED_KEY, sampled)
163163

164-
# sample_rate should always be updated to ensure complete traces
165164
if sample_rate is not None:
166165
trace_state = trace_state.update(TRACESTATE_SAMPLE_RATE_KEY, str(sample_rate))
167166

168-
# only add sample_rand if there isn't one
169167
if sample_rand is not None:
170-
trace_state = trace_state.add(
168+
trace_state = trace_state.update(
171169
TRACESTATE_SAMPLE_RAND_KEY, f"{sample_rand:.6f}" # noqa: E231
172170
)
173171

0 commit comments

Comments
 (0)