-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
fix(sampling): Sample transactions without DSC #1667
Conversation
fa5c50c
to
bb3e8d3
Compare
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 looks good to me, do we need to add a test to cover the new behavior?
if let Some(state) = self.valid_state() { | ||
// Never use rules from another organization. | ||
if state.organization_id == message.project_state.organization_id { | ||
message.sampling_project_state = Some(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.
Should we log a statsd metric to know how often this happens?
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 was thinking about this. Are we interested in how often this happens or how many projects this happens with? I haven't found a good way to log something truly useful.
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.
Hmm yeah maybe add the project ID / org ID to a set metric?
Dynamic sampling relies on the Dynamic Sampling Context (DSC). The envelope header contains information about the trace, the origin project, and attributes for trace sampling.
Originally, when the DSC is not specified in an envelope, dynamic sampling did not run on the envelope. Transaction events in this envelope are effectively sampled at 100% percent. However, there are more cases where the DSC is not available or not valid:
This PR makes the following changes: