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

Rename remaining usage of default_sampler #509

Merged
merged 2 commits into from Apr 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions opentelemetry/src/sdk/trace/config.rs
Expand Up @@ -16,7 +16,7 @@ pub fn config() -> Config {
#[derive(Debug)]
pub struct Config {
/// The sampler that the sdk should use
pub default_sampler: Box<dyn sdk::trace::ShouldSample>,
pub sampler: Box<dyn sdk::trace::ShouldSample>,
/// The id generator that the sdk should use
pub id_generator: Box<dyn IdGenerator>,
/// The max events that can be added to a `Span`.
Expand All @@ -30,9 +30,9 @@ pub struct Config {
}

impl Config {
/// Specify the default sampler to be used.
/// Specify the sampler to be used.
pub fn with_sampler<T: sdk::trace::ShouldSample + 'static>(mut self, sampler: T) -> Self {
self.default_sampler = Box::new(sampler);
self.sampler = Box::new(sampler);
self
}

Expand Down Expand Up @@ -71,7 +71,7 @@ impl Default for Config {
/// Create default global sdk configuration.
fn default() -> Self {
let mut config = Config {
default_sampler: Box::new(Sampler::ParentBased(Box::new(Sampler::AlwaysOn))),
sampler: Box::new(Sampler::ParentBased(Box::new(Sampler::AlwaysOn))),
id_generator: Box::new(sdk::trace::IdGenerator::default()),
max_events_per_span: 128,
max_attributes_per_span: 128,
Expand Down
2 changes: 1 addition & 1 deletion opentelemetry/src/sdk/trace/tracer.rs
Expand Up @@ -76,7 +76,7 @@ impl Tracer {
links: &[Link],
config: &Config,
) -> Option<(u8, Vec<KeyValue>, TraceState)> {
let sampling_result = config.default_sampler.should_sample(
let sampling_result = config.sampler.should_sample(
Some(parent_cx),
trace_id,
name,
Expand Down