Skip to content

Commit

Permalink
Rename remaining usage of default_sampler (#509)
Browse files Browse the repository at this point in the history
  • Loading branch information
jtescher committed Apr 4, 2021
1 parent 92d722b commit 155d03d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
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

0 comments on commit 155d03d

Please sign in to comment.