Skip to content

Commit 6b40f20

Browse files
committed
feature: expose SimpleSpanProcessor::new
This commit update the visibility of the method `SimpleSpanProcessor::new` from `pub(crate)` to `pub`. This enables consumers to create `SimpleSpanProcessor` values for use with `trace::provider::Builder::with_span_processor`. In particular, this fixes a consistency issue: the `BatchSpanProcessor` struct may already be built thanks to its `pub` builder. With this change, both processors in this repo may be built manually. Closes #2060
1 parent 7ab5e0f commit 6b40f20

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

opentelemetry-sdk/CHANGELOG.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
- Update `async-std` dependency version to 1.13
66
- *Breaking* - Remove support for `MetricProducer` which allowed metrics from
77
external sources to be sent through OpenTelemetry.
8-
[#2105](https://github.com/open-telemetry/opentelemetry-rust/pull/2105)
8+
[#2105](https://github.com/open-telemetry/opentelemetry-rust/pull/2105)
9+
- Feature: `SimpleSpanProcessor::new` is now public [#2119](https://github.com/open-telemetry/opentelemetry-rust/pull/2119)
910

1011
## v0.25.0
1112

opentelemetry-sdk/src/trace/span_processor.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,8 @@ pub struct SimpleSpanProcessor {
109109
}
110110

111111
impl SimpleSpanProcessor {
112-
pub(crate) fn new(exporter: Box<dyn SpanExporter>) -> Self {
112+
/// Create a new [SimpleSpanProcessor] using the provided exporter.
113+
pub fn new(exporter: Box<dyn SpanExporter>) -> Self {
113114
Self {
114115
exporter: Mutex::new(exporter),
115116
}

0 commit comments

Comments
 (0)