-
Notifications
You must be signed in to change notification settings - Fork 530
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
Update sample rate in DSC #4018
Conversation
❌ 1 Tests Failed:
View the top 1 failed tests by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
propagation_context = self.get_active_propagation_context() | ||
if propagation_context: | ||
dsc = propagation_context.dynamic_sampling_context | ||
if dsc is not None: | ||
dsc["sample_rate"] = str(transaction.sample_rate) | ||
if transaction._baggage: | ||
transaction._baggage.sentry_items["sample_rate"] = str( | ||
transaction.sample_rate | ||
) |
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.
For some reason, the baggage on the transaction is independent from the propagation context? In any case, I'm changing both here...
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.
I think that's ok. transaction._baggage
is for the current transaction and on the scope it is for future transactions. So looks correct.
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.
This should work. Nice!
propagation_context = self.get_active_propagation_context() | ||
if propagation_context: | ||
dsc = propagation_context.dynamic_sampling_context | ||
if dsc is not None: | ||
dsc["sample_rate"] = str(transaction.sample_rate) | ||
if transaction._baggage: | ||
transaction._baggage.sentry_items["sample_rate"] = str( | ||
transaction.sample_rate | ||
) |
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.
I think that's ok. transaction._baggage
is for the current transaction and on the scope it is for future transactions. So looks correct.
sample_rate
in DSC after the initial sampling decision is madePart of #3999