Skip to content
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

Fix RuleSampler forwarding #update to sampler without #update #950

Merged
merged 1 commit into from
Feb 20, 2020

Conversation

delner
Copy link
Contributor

@delner delner commented Feb 18, 2020

Fixes #949

Normally, the RuleSampler has a default sampler of RateByServiceSampler which responds to #update. When the RuleSampler is configured with a default sample rate, it sets a RateSampler as its default sampler, which does not respond to #update.

Thus when the transport receives priority sampling rates and attempts to update the sampler, it calls RuleSampler with update and attempts to forward to RateSampler which raises a NoMethodError.

In this pull request, we check if the default sampler responds to #update before forwarding. If it does not, return false instead.

@delner delner added bug Involves a bug core Involves Datadog core libraries community Was opened by a community member labels Feb 18, 2020
@delner delner requested review from marcotc and a team February 18, 2020 18:33
@delner delner self-assigned this Feb 18, 2020
@delner
Copy link
Contributor Author

delner commented Feb 18, 2020

@BabyGroot I think this should fix your issue... can you try out this PR and confirm it fixes the bug you were seeing?

@delner delner force-pushed the fix/rule_sampler_update_error branch from 9589203 to d717ed3 Compare February 18, 2020 22:07
@BabyGroot
Copy link

@BabyGroot I think this should fix your issue... can you try out this PR and confirm it fixes the bug you were seeing?

Thanks so much for the PR! 🙏 Will test it ASAP, just a bit swamped with ops at the moment...

marcotc
marcotc previously approved these changes Feb 19, 2020
Copy link
Member

@marcotc marcotc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉 thank you for the fix!

@BabyGroot
Copy link

I have tested in staging and don't see that log error happening. LGTM, thank you!

@delner delner merged commit f61cb22 into master Feb 20, 2020
@delner delner deleted the fix/rule_sampler_update_error branch February 20, 2020 18:36
@delner delner added this to the 0.33.0 milestone Mar 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Involves a bug community Was opened by a community member core Involves Datadog core libraries
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Undefined method `update' for #<Datadog::RateSampler>.
3 participants