-
Notifications
You must be signed in to change notification settings - Fork 552
Port sample_rate
update to potel-base
#4069
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
❌ 736 Tests Failed:
View the top 3 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
8d3bfce
to
7842236
Compare
f22283d
to
3061f57
Compare
…entry/sentry-python into ivana/potel/port-sample-rate-update
…entry/sentry-python into ivana/potel/port-sample-rate-update
…ide the sampled field in trace_state
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested it and works as expected. Nice work!
@@ -123,7 +123,7 @@ def _incoming_otel_span_context(self): | ||
# for twp to work, we also need to consider deferred sampling when the sampling | ||
# flag is not present, so the above TraceFlags are not sufficient | ||
if self._propagation_context.parent_sampled is None: | ||
trace_state = trace_state.add(TRACESTATE_SAMPLED_KEY, "deferred") | ||
trace_state = trace_state.update(TRACESTATE_SAMPLED_KEY, "deferred") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added this change, to make sure we set sentry-sampled to deferred in any case. If there is already a entry sentry-sampled in the trace_state then .add() will not do anything.
(There can be a sentry-sampled in the trace_state if the upstream SDK sends the sentry-sampled
DSC entry with the baggage
http request. If there was no upstream sampling descision, this entry should either not be sent, of if sent than as None
.)
This change works in both cases.
…entry/sentry-python into ivana/potel/port-sample-rate-update
If the SDK uses a specific sample rate for a trace, it needs to update it in the DSC for downstream SDKs.
Closes #4028