Skip to content

Commit

Permalink
review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
lalitb committed Nov 2, 2024
1 parent 4fb3945 commit 0009061
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions opentelemetry-sdk/src/trace/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ impl Default for Config {
Box::new(Sampler::TraceIdRatioBased(r))
} else {
otel_warn!(

Check warning on line 132 in opentelemetry-sdk/src/trace/config.rs

View check run for this annotation

Codecov / codecov/patch

opentelemetry-sdk/src/trace/config.rs#L132

Added line #L132 was not covered by tests
name: "TracerProvider.Config.Sampler.InvalidArgument",
name: "TracerProvider.Config.InvalidSamplerArgument",
message = "OTEL_TRACES_SAMPLER is set to 'traceidratio' but OTEL_TRACES_SAMPLER_ARG environment variable is missing or invalid. OTEL_TRACES_SAMPLER_ARG must be a valid float between 0.0 and 1.0 representing the desired sampling probability (0.0 = no traces sampled, 1.0 = all traces sampled, 0.5 = 50% of traces sampled). Falling back to default ratio: 1.0 (100% sampling)",
otel_traces_sampler_arg = format!("{:?}", sampler_arg)

Check warning on line 135 in opentelemetry-sdk/src/trace/config.rs

View check run for this annotation

Codecov / codecov/patch

opentelemetry-sdk/src/trace/config.rs#L135

Added line #L135 was not covered by tests
);
Expand All @@ -151,7 +151,7 @@ impl Default for Config {
))))
} else {
otel_warn!(

Check warning on line 153 in opentelemetry-sdk/src/trace/config.rs

View check run for this annotation

Codecov / codecov/patch

opentelemetry-sdk/src/trace/config.rs#L153

Added line #L153 was not covered by tests
name: "TracerProvider.Config.Sampler.InvalidArgument",
name: "TracerProvider.Config.InvalidSamplerArgument",
message = "OTEL_TRACES_SAMPLER is set to 'parentbased_traceidratio' but OTEL_TRACES_SAMPLER_ARG environment variable is missing or invalid. OTEL_TRACES_SAMPLER_ARG must be a valid float between 0.0 and 1.0 representing the desired sampling probability (0.0 = no traces sampled, 1.0 = all traces sampled, 0.5 = 50% of traces sampled). Falling back to default ratio: 1.0 (100% sampling)",
otel_traces_sampler_arg = format!("{:?}", sampler_arg)

Check warning on line 156 in opentelemetry-sdk/src/trace/config.rs

View check run for this annotation

Codecov / codecov/patch

opentelemetry-sdk/src/trace/config.rs#L156

Added line #L156 was not covered by tests
);
Expand All @@ -162,28 +162,28 @@ impl Default for Config {
}
"parentbased_jaeger_remote" => {
otel_warn!(
name: "TracerProvider.Config.Sampler.Unsupported",
name: "TracerProvider.Config.UnsupportedSampler",
message = "OTEL_TRACES_SAMPLER is set to 'parentbased_jaeger_remote' which is not implemented in this SDK version. Using fallback sampler: ParentBased(AlwaysOn). Configure an alternative sampler using OTEL_TRACES_SAMPLER"
);

Check warning on line 167 in opentelemetry-sdk/src/trace/config.rs

View check run for this annotation

Codecov / codecov/patch

opentelemetry-sdk/src/trace/config.rs#L164-L167

Added lines #L164 - L167 were not covered by tests
Box::new(Sampler::ParentBased(Box::new(Sampler::AlwaysOn)))
}
"jaeger_remote" => {
otel_warn!(
name: "TracerProvider.Config.Sampler.Unsupported",
name: "TracerProvider.Config.UnsupportedSampler",
message = "OTEL_TRACES_SAMPLER is set to 'jaeger_remote' which is implemented in this SDK version. Using fallback sampler: ParentBased(AlwaysOn). Configure an alternative sampler using OTEL_TRACES_SAMPLER"
);

Check warning on line 174 in opentelemetry-sdk/src/trace/config.rs

View check run for this annotation

Codecov / codecov/patch

opentelemetry-sdk/src/trace/config.rs#L171-L174

Added lines #L171 - L174 were not covered by tests
Box::new(Sampler::ParentBased(Box::new(Sampler::AlwaysOn)))
}
"xray" => {
otel_warn!(
name: "TracerProvider.Config.Sampler.Unsupported",
name: "TracerProvider.Config.UnsupportedSampler",
message = "OTEL_TRACES_SAMPLER is set to 'xray'. AWS X-Ray sampler is not implemented in this SDK version. Using fallback sampler: ParentBased(AlwaysOn). Configure an alternative sampler using OTEL_TRACES_SAMPLER"
);

Check warning on line 181 in opentelemetry-sdk/src/trace/config.rs

View check run for this annotation

Codecov / codecov/patch

opentelemetry-sdk/src/trace/config.rs#L178-L181

Added lines #L178 - L181 were not covered by tests
Box::new(Sampler::ParentBased(Box::new(Sampler::AlwaysOn)))
}
s => {
otel_warn!(

Check warning on line 185 in opentelemetry-sdk/src/trace/config.rs

View check run for this annotation

Codecov / codecov/patch

opentelemetry-sdk/src/trace/config.rs#L185

Added line #L185 was not covered by tests
name: "TracerProvider.Config.Sampler.InvalidSamplerType",
name: "TracerProvider.Config.InvalidSamplerType",
message = format!(
"Unrecognized sampler type '{}' in OTEL_TRACES_SAMPLER environment variable. Valid values are: always_on, always_off, traceidratio, parentbased_always_on, parentbased_always_off, parentbased_traceidratio. Using fallback sampler: ParentBased(AlwaysOn)",
s
Expand Down
2 changes: 1 addition & 1 deletion opentelemetry-sdk/src/trace/span_processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ impl<R: RuntimeChannel> SpanProcessor for BatchSpanProcessor<R> {

if let Err(err) = result {
otel_debug!(

Check warning on line 253 in opentelemetry-sdk/src/trace/span_processor.rs

View check run for this annotation

Codecov / codecov/patch

opentelemetry-sdk/src/trace/span_processor.rs#L253

Added line #L253 was not covered by tests
name: "BatchSpanProcessor.Export.SendResultError",
name: "BatchSpanProcessor.ExportQueueingFailed",
reason = format!("{:?}", TraceError::Other(err.into()))

Check warning on line 255 in opentelemetry-sdk/src/trace/span_processor.rs

View check run for this annotation

Codecov / codecov/patch

opentelemetry-sdk/src/trace/span_processor.rs#L255

Added line #L255 was not covered by tests
);
}
Expand Down

0 comments on commit 0009061

Please sign in to comment.